本文整理汇总了C#中Microsoft.SqlServer.Server.SmiEventSink_Default.ProcessMessagesAndThrow方法的典型用法代码示例。如果您正苦于以下问题:C# SmiEventSink_Default.ProcessMessagesAndThrow方法的具体用法?C# SmiEventSink_Default.ProcessMessagesAndThrow怎么用?C# SmiEventSink_Default.ProcessMessagesAndThrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.SqlServer.Server.SmiEventSink_Default
的用法示例。
在下文中一共展示了SmiEventSink_Default.ProcessMessagesAndThrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCharArray_Unchecked
private static char[] GetCharArray_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
long length = getters.GetCharsLength( sink, ordinal );
sink.ProcessMessagesAndThrow();
int len = checked( (int)length );
char[] buffer = new char[len];
getters.GetChars( sink, ordinal, 0, buffer, 0, len );
sink.ProcessMessagesAndThrow();
return buffer;
}
示例2: SetDbDataReader_Unchecked
// Set a DbDataReader to a Structured+MultiValued setter (table type)
// Assumes metaData correctly describes the reader's shape, and consumes only the current resultset
private static void SetDbDataReader_Unchecked(
SmiEventSink_Default sink,
SmiTypedGetterSetter setters,
int ordinal,
SmiMetaData metaData,
DbDataReader value
) {
// Get the target gettersetter
setters = setters.GetTypedGetterSetter(sink, ordinal);
sink.ProcessMessagesAndThrow();
// Iterate over all rows in the current set of results
while (value.Read()) {
setters.NewElement(sink);
sink.ProcessMessagesAndThrow();
FillCompatibleSettersFromReader(sink, setters, metaData.FieldMetaData, value);
}
setters.EndElements(sink);
sink.ProcessMessagesAndThrow();
}
示例3: GetSqlValue200
// dealing with v200 SMI
internal static object GetSqlValue200(
SmiEventSink_Default sink,
SmiTypedGetterSetter getters,
int ordinal,
SmiMetaData metaData,
SmiContext context
) {
object result = null;
if (IsDBNull_Unchecked(sink, getters, ordinal)) {
if (SqlDbType.Udt == metaData.SqlDbType) {
result = NullUdtInstance(metaData);
} else {
result = __typeSpecificNullForSqlValue[(int)metaData.SqlDbType];
}
} else {
switch (metaData.SqlDbType) {
case SqlDbType.Variant: // Handle variants specifically for v200, since they could contain v200 types
metaData = getters.GetVariantType(sink, ordinal);
sink.ProcessMessagesAndThrow();
Debug.Assert(SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!");
result = GetSqlValue200(sink, getters, ordinal, metaData, context);
break;
case SqlDbType.Date:
case SqlDbType.DateTime2:
result = GetDateTime_Unchecked(sink, getters, ordinal);
break;
case SqlDbType.Time:
result = GetTimeSpan_Unchecked(sink, getters, ordinal);
break;
case SqlDbType.DateTimeOffset:
result = GetDateTimeOffset_Unchecked(sink, getters, ordinal);
break;
default:
result = GetSqlValue(sink, getters, ordinal, metaData, context);
break;
}
}
return result;
}
示例4: SetSqlXml_Unchecked
private static void SetSqlXml_Unchecked(SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SqlXml value) {
if (value.IsNull) {
setters.SetDBNull(sink, ordinal);
sink.ProcessMessagesAndThrow();
}
else {
SetXmlReader_Unchecked(sink, setters, ordinal, value.CreateReader());
}
}
示例5: SetString_Unchecked
private static void SetString_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, String value, int offset, int length ) {
setters.SetString( sink, ordinal, value, offset, length );
sink.ProcessMessagesAndThrow();
}
示例6: SetSqlChars_Unchecked
private static void SetSqlChars_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SqlChars value, int offset, int length ) {
if ( value.IsNull ) {
setters.SetDBNull( sink, ordinal );
sink.ProcessMessagesAndThrow();
}
else {
int chunkSize;
if ( length > __maxCharChunkSize || length < 0 ) {
chunkSize = __maxCharChunkSize;
}
else {
chunkSize = checked( (int)length );
}
char[] buffer = new char[ chunkSize ];
long charsRead;
long charsWritten = 1; // prime value to get into write loop
long currentOffset = offset;
long lengthWritten = 0;
while ( (length < 0 || lengthWritten < length) &&
0 != ( charsRead = value.Read( currentOffset, buffer, 0, chunkSize ) ) &&
0 != charsWritten ) {
charsWritten = setters.SetChars( sink, ordinal, currentOffset, buffer, 0, checked( (int) charsRead ) );
sink.ProcessMessagesAndThrow();
checked{ currentOffset += charsWritten; }
checked{ lengthWritten += charsWritten;}
}
// Make sure to trim any left-over data
setters.SetCharsLength( sink, ordinal, currentOffset );
sink.ProcessMessagesAndThrow();
}
}
示例7: SetSqlSingle_Unchecked
private static void SetSqlSingle_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SqlSingle value ) {
if ( value.IsNull ) {
setters.SetDBNull( sink, ordinal );
}
else {
setters.SetSingle( sink, ordinal, value.Value );
}
sink.ProcessMessagesAndThrow();
}
示例8: GetString_Unchecked
private static String GetString_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
// Note: depending on different getters, the result string maybed truncated, e.g. for
// Inproc process, the getter is InProcRecordBuffer (implemented in SqlAcess), string will be
// truncated to 4000 (if length is more than 4000). If MemoryRecordBuffer getter is used, data
// is not truncated. Please refer VSDD 479655 for more detailed information regarding the string length.
String result = getters.GetString( sink, ordinal );
sink.ProcessMessagesAndThrow();
return result;
}
示例9: GetTimeSpan_Unchecked
private static TimeSpan GetTimeSpan_Unchecked(SmiEventSink_Default sink, SmiTypedGetterSetter getters, int ordinal) {
Debug.Assert(!IsDBNull_Unchecked(sink, getters, ordinal));
TimeSpan result = getters.GetTimeSpan(sink, ordinal);
sink.ProcessMessagesAndThrow();
return result;
}
示例10: GetSqlDecimal_Unchecked
private static SqlDecimal GetSqlDecimal_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
SqlDecimal result = getters.GetSqlDecimal( sink, ordinal );
sink.ProcessMessagesAndThrow();
return result;
}
示例11: GetSqlMoney_Unchecked
private static SqlMoney GetSqlMoney_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
Int64 temp = getters.GetInt64( sink, ordinal );
sink.ProcessMessagesAndThrow();
return new SqlMoney( temp, 1 /* ignored */ );
}
示例12: GetDateTime_Unchecked
private static DateTime GetDateTime_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
DateTime result = getters.GetDateTime( sink, ordinal );
sink.ProcessMessagesAndThrow();
return result;
}
示例13: GetCharsLength_Unchecked
private static long GetCharsLength_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
long result = getters.GetCharsLength( sink, ordinal );
sink.ProcessMessagesAndThrow();
return result;
}
示例14: GetChars_Unchecked
internal static int GetChars_Unchecked( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length ) {
Debug.Assert( !IsDBNull_Unchecked( sink, getters, ordinal ) );
Debug.Assert(ordinal >= 0, string.Format("Invalid ordinal: {0}", ordinal));
Debug.Assert(sink != null, "Null SmiEventSink");
Debug.Assert(getters != null, "Null getters");
Debug.Assert(fieldOffset >= 0, string.Format("Invalid field offset: {0}", fieldOffset));
Debug.Assert(buffer != null, "Null buffer");
Debug.Assert(bufferOffset >= 0 && length >= 0 && bufferOffset + length <= buffer.Length, string.Format("Bad offset or length. bufferOffset: {0}, length: {1}, buffer.Length{2}", bufferOffset, length, buffer.Length));
int result = getters.GetChars( sink, ordinal, fieldOffset, buffer, bufferOffset, length );
sink.ProcessMessagesAndThrow();
return result;
}
示例15: SetSingle_Unchecked
private static void SetSingle_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, Single value ) {
setters.SetSingle( sink, ordinal, value );
sink.ProcessMessagesAndThrow();
}