本文整理汇总了C#中ITypedSettersV3.SetVariantMetaData方法的典型用法代码示例。如果您正苦于以下问题:C# ITypedSettersV3.SetVariantMetaData方法的具体用法?C# ITypedSettersV3.SetVariantMetaData怎么用?C# ITypedSettersV3.SetVariantMetaData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypedSettersV3
的用法示例。
在下文中一共展示了ITypedSettersV3.SetVariantMetaData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSqlString_Unchecked
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 );
}
}
示例2: SetDate_Unchecked
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();
}
示例3: SetSqlMoney_Unchecked
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();
}
示例4: SetSqlString_Unchecked
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);
}
}