示例#1
0
        public static void WriteValue(TdsPackageWriter writer, object?value, TdsMetaType.MetaDataWrite metaData, bool isNull)
        {
            // write the value now
            if (isNull)
            {
                return;
            }
            switch (value)
            {
            case string v:
                writer.WriteUnicodeString(v);
                break;

            case decimal v:
                writer.WriteSqlDecimal(v, 17);
                break;

            case bool v:
                writer.WriteByte(v ? 1 : 0);
                break;

            case DateTime v:
                writer.WriteDateTime(v);
                break;

            case byte v:
                writer.WriteByte(v);
                break;

            case short v:
                writer.WriteInt16(v);
                break;

            case int v:
                writer.WriteInt32(v);
                break;

            case long v:
                writer.WriteInt64(v);
                break;

            case float v:
                writer.WriteFloat(v);
                break;

            case double v:
                writer.WriteDouble(v);
                break;
            }
        }
示例#2
0
 public void WriteSqlFloat(float value, int index)
 {
     _writer.WriteFloat(value);
 }