本文整理汇总了C#中System.Data.SqlClient.TdsParserStateObject.AssertStateIsClean方法的典型用法代码示例。如果您正苦于以下问题:C# TdsParserStateObject.AssertStateIsClean方法的具体用法?C# TdsParserStateObject.AssertStateIsClean怎么用?C# TdsParserStateObject.AssertStateIsClean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.TdsParserStateObject
的用法示例。
在下文中一共展示了TdsParserStateObject.AssertStateIsClean方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PutSession
internal void PutSession(TdsParserStateObject session)
{
session.AssertStateIsClean();
if (MARSOn)
{
// This will take care of disposing if the parser is closed
_sessionPool.PutSession(session);
}
else if ((_state == TdsParserState.Closed) || (_state == TdsParserState.Broken))
{
// Parser is closed\broken - dispose the stateObj
Debug.Assert(session == _physicalStateObj, "MARS is off, but session to close is not the _physicalStateObj");
_physicalStateObj.SniContext = SniContext.Snix_Close;
#if DEBUG
_physicalStateObj.InvalidateDebugOnlyCopyOfSniContext();
#endif
_physicalStateObj.Dispose();
}
else
{
// Non-MARS, and session is ok - remove its owner
_physicalStateObj.Owner = null;
}
}