本文整理汇总了C#中System.Data.SqlClient.SqlCommand.OnDoneProc方法的典型用法代码示例。如果您正苦于以下问题:C# SqlCommand.OnDoneProc方法的具体用法?C# SqlCommand.OnDoneProc怎么用?C# SqlCommand.OnDoneProc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlCommand
的用法示例。
在下文中一共展示了SqlCommand.OnDoneProc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryRun
//.........这里部分代码省略.........
{
_SqlMetaDataSet metaDataSet;
if (!TryProcessColInfo(dataStream.MetaData, dataStream, stateObj, out metaDataSet))
{
return false;
}
if (!dataStream.TrySetMetaData(metaDataSet, false))
{
return false;
}
dataStream.BrowseModeInfoConsumed = true;
}
else
{ // no dataStream
if (!stateObj.TrySkipBytes(tokenLength))
{
return false;
}
}
break;
}
case TdsEnums.SQLDONE:
case TdsEnums.SQLDONEPROC:
case TdsEnums.SQLDONEINPROC:
{
// RunBehavior can be modified
if (!TryProcessDone(cmdHandler, dataStream, ref runBehavior, stateObj))
{
return false;
}
if ((token == TdsEnums.SQLDONEPROC) && (cmdHandler != null))
{
cmdHandler.OnDoneProc();
}
break;
}
case TdsEnums.SQLORDER:
{
// don't do anything with the order token so read off the pipe
if (!stateObj.TrySkipBytes(tokenLength))
{
return false;
}
break;
}
case TdsEnums.SQLALTMETADATA:
{
stateObj.CloneCleanupAltMetaDataSetArray();
if (stateObj._cleanupAltMetaDataSetArray == null)
{
// create object on demand (lazy creation)
stateObj._cleanupAltMetaDataSetArray = new _SqlMetaDataSetCollection();
}
_SqlMetaDataSet cleanupAltMetaDataSet;
if (!TryProcessAltMetaData(tokenLength, stateObj, out cleanupAltMetaDataSet))
{
return false;
}
stateObj._cleanupAltMetaDataSetArray.SetAltMetaData(cleanupAltMetaDataSet);
示例2: Run
//.........这里部分代码省略.........
this._currentTransaction.TransactionId = changeArray[i].newLongValue;
goto Label_04B4;
case 9:
case 12:
case 0x11:
this._retainedTransactionId = 0L;
goto Label_04F7;
case 10:
goto Label_04F7;
default:
goto Label_0577;
}
TransactionType type = (8 == changeArray[i].type) ? TransactionType.LocalFromTSQL : TransactionType.Distributed;
this._currentTransaction = new SqlInternalTransaction(this._connHandler, type, null, changeArray[i].newLongValue);
Label_04B4:
if ((this._statistics != null) && !this._statisticsIsInTransaction)
{
this._statistics.SafeIncrement(ref this._statistics._transactions);
}
this._statisticsIsInTransaction = true;
this._retainedTransactionId = 0L;
continue;
Label_04F7:
if (this._currentTransaction != null)
{
if (9 == changeArray[i].type)
{
this._currentTransaction.Completed(TransactionState.Committed);
}
else if (10 == changeArray[i].type)
{
if (this._currentTransaction.IsDistributed && this._currentTransaction.IsActive)
{
this._retainedTransactionId = changeArray[i].oldLongValue;
}
this._currentTransaction.Completed(TransactionState.Aborted);
}
else
{
this._currentTransaction.Completed(TransactionState.Unknown);
}
this._currentTransaction = null;
}
this._statisticsIsInTransaction = false;
continue;
Label_0577:
this._connHandler.OnEnvChange(changeArray[i]);
}
goto Label_06D5;
}
case 0xfd:
case 0xfe:
case 0xff:
this.ProcessDone(cmdHandler, dataStream, ref runBehavior, stateObj);
if ((token == 0xfe) && (cmdHandler != null))
{
cmdHandler.OnDoneProc();
}
goto Label_06D5;
case 0xed:
this.ProcessSSPI(tokenLength);
goto Label_06D5;
default:
goto Label_06D5;
}
if (this._statistics != null)
{
this._statistics.WaitForDoneAfterRow = true;
}
flag = true;
Label_06D5:
if ((stateObj._pendingData && (RunBehavior.ReturnImmediately != (RunBehavior.ReturnImmediately & runBehavior))) || ((!stateObj._pendingData && stateObj._attentionSent) && !stateObj._attentionReceived))
{
goto Label_0016;
}
Label_0705:
if (!stateObj._pendingData && (this.CurrentTransaction != null))
{
this.CurrentTransaction.Activate();
}
if (stateObj._attentionSent && stateObj._attentionReceived)
{
stateObj._attentionSent = false;
stateObj._attentionReceived = false;
if ((RunBehavior.Clean != (RunBehavior.Clean & runBehavior)) && !stateObj._internalTimeout)
{
this.Errors.Add(new SqlError(0, 0, 11, this._server, SQLMessage.OperationCancelled(), "", 0));
}
}
if ((this._errors != null) || (this._warnings != null))
{
this.ThrowExceptionAndWarning();
}
return flag;
}