Пример #1
0
        private SqlString ToString(SqlDateTime dateTime)
        {
            if (dateTime.IsNull)
            {
                return(SqlString.Null);
            }

            if (TypeCode == SqlTypeCode.Date)
            {
                return(dateTime.ToDateString());
            }
            if (TypeCode == SqlTypeCode.Time)
            {
                return(dateTime.ToTimeString());
            }
            if (TypeCode == SqlTypeCode.TimeStamp)
            {
                return(dateTime.ToTimeStampString());
            }

            return(SqlString.Null);
        }
Пример #2
0
        private SqlString ToString(SqlDateTime dateTime)
        {
            if (dateTime.IsNull)
                return SqlString.Null;

            if (TypeCode == SqlTypeCode.Date)
                return dateTime.ToDateString();
            if (TypeCode == SqlTypeCode.Time)
                return dateTime.ToTimeString();
            if (TypeCode == SqlTypeCode.TimeStamp)
                return dateTime.ToTimeStampString();

            return SqlString.Null;
        }