Пример #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());
            }
Пример #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));
        }
Пример #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));
        }