Ejemplo n.º 1
0
            protected override string BuildValue(QConst value)
            {
                object constValue = value.Value;

                // special processing for arrays
                if (constValue is IList)
                {
                    return(BuildValue((IList)constValue));
                }

                if (constValue is DateTime)
                {
                    // Date values should be enclosed within pound signs (#). (MSDN)
                    return("#" + constValue.ToString() + "#");
                }

                if (constValue is string)
                {
                    return("'" + constValue.ToString().Replace("'", "''") + "'");
                }

                if (constValue == DBNull.Value)
                {
                    return("NULL");
                }

                return(constValue.ToString());
            }
Ejemplo n.º 2
0
        protected override string BuildValue(QConst value)
        {
            object constValue = value.Value;

            // special processing for arrays
            if (constValue is IList)
            {
                return(BuildValue((IList)constValue));
            }

            return(BuildCommandParameter(constValue));
        }
Ejemplo n.º 3
0
        protected virtual string BuildValue(QConst value)
        {
            object constValue = value.Value;

            // special processing for arrays
            if (constValue is IList)
            {
                return(BuildValue((IList)constValue));
            }
            if (constValue is string)
            {
                return(BuildValue((string)constValue));
            }

            return(Convert.ToString(constValue, System.Globalization.CultureInfo.InvariantCulture));
        }