private static void SetSqlString_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData, SqlString value, int offset, int length ) { if ( value.IsNull ) { setters.SetDBNull( sink, ordinal ); sink.ProcessMessagesAndThrow(); } else { if (SqlDbType.Variant == metaData.SqlDbType) { // Set up a NVarChar metadata with correct LCID/Collation metaData = new SmiMetaData( SqlDbType.NVarChar, SmiMetaData.MaxUnicodeCharacters, 0, 0, value.LCID, value.SqlCompareOptions, null); setters.SetVariantMetaData( sink, ordinal, metaData ); sink.ProcessMessagesAndThrow(); } SetString_Unchecked( sink, setters, ordinal, value.Value, offset, length ); } }
private static void SetDate_Unchecked(SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData, DateTime value) { Debug.Assert(SqlDbType.Variant == metaData.SqlDbType, "Invalid type. This should be called only when the type is variant."); setters.SetVariantMetaData(sink, ordinal, SmiMetaData.DefaultDate); setters.SetDateTime(sink, ordinal, value); sink.ProcessMessagesAndThrow(); }
private static void SetSqlMoney_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData, SqlMoney value ) { if ( value.IsNull ) { setters.SetDBNull( sink, ordinal ); } else { if ( SqlDbType.Variant == metaData.SqlDbType ) { setters.SetVariantMetaData( sink, ordinal, SmiMetaData.DefaultMoney ); sink.ProcessMessagesAndThrow(); } setters.SetInt64( sink, ordinal, value.ToSqlInternalRepresentation() ); } sink.ProcessMessagesAndThrow(); }
private static void SetSqlString_Unchecked(SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData, SqlString value, int offset, int length) { if (value.IsNull) { setters.SetDBNull(sink, ordinal); sink.ProcessMessagesAndThrow(); } else { if (SqlDbType.Variant == metaData.SqlDbType) { metaData = new SmiMetaData(SqlDbType.NVarChar, 0xfa0L, 0, 0, (long) value.LCID, value.SqlCompareOptions, null); setters.SetVariantMetaData(sink, ordinal, metaData); sink.ProcessMessagesAndThrow(); } SetString_Unchecked(sink, setters, ordinal, value.Value, offset, length); } }