예제 #1
0
        private ISqlString ToString(SqlDateTime date, SqlCharacterType destType)
        {
            var dateString = ToString(date);
            var s          = new SqlString(dateString);

            return((ISqlString)destType.NormalizeValue(s));
        }
        private ISqlValue ToString(SqlNumber number, SqlCharacterType destType)
        {
            if (destType.HasMaxSize && number.Precision > destType.MaxSize)
            {
                return(SqlNull.Value);
            }

            var s = number.ToString();

            return(destType.NormalizeValue(new SqlString(s)));
        }
        private ISqlValue ToString(ISqlBinary binary, SqlCharacterType destType)
        {
            if (binary == null)
            {
                throw new InvalidCastException();
            }

            var bytes = binary.ToArray();
            var s     = new SqlString(bytes);

            return(destType.NormalizeValue(s));
        }
예제 #4
0
        private ISqlString ToString(SqlBoolean value, SqlCharacterType destType)
        {
            var s = new SqlString(ToString(value));

            return((ISqlString)destType.NormalizeValue(s));
        }
        private ISqlValue ToString(SqlDayToSecond dts, SqlCharacterType destType)
        {
            var s = new SqlString(dts.ToString());

            return(destType.NormalizeValue(s));
        }