本文整理汇总了C#中System.Data.SqlClient.SqlCommand.OnReturnValue方法的典型用法代码示例。如果您正苦于以下问题:C# SqlCommand.OnReturnValue方法的具体用法?C# SqlCommand.OnReturnValue怎么用?C# SqlCommand.OnReturnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlCommand
的用法示例。
在下文中一共展示了SqlCommand.OnReturnValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryRun
//.........这里部分代码省略.........
}
}
else
{
dataReady = true;
}
if (_statistics != null)
{
_statistics.WaitForDoneAfterRow = true;
}
break;
}
case TdsEnums.SQLRETURNSTATUS:
int status;
if (!stateObj.TryReadInt32(out status))
{
return false;
}
if (cmdHandler != null)
{
cmdHandler.OnReturnStatus(status);
}
break;
case TdsEnums.SQLRETURNVALUE:
{
SqlReturnValue returnValue;
if (!TryProcessReturnValue(tokenLength, stateObj, out returnValue))
{
return false;
}
if (cmdHandler != null)
{
cmdHandler.OnReturnValue(returnValue);
}
break;
}
case TdsEnums.SQLSSPI:
{
// token length is length of SSPI data - call ProcessSSPI with it
Debug.Assert(stateObj._syncOverAsync, "ProcessSSPI does not support retry, do not attempt asynchronously");
stateObj._syncOverAsync = true;
ProcessSSPI(tokenLength);
break;
}
case TdsEnums.SQLTABNAME:
{
{
if (!stateObj.TrySkipBytes(tokenLength))
{
return false;
}
}
break;
}
default:
Debug.Assert(false, "Unhandled token: " + token.ToString(CultureInfo.InvariantCulture));
break;
}
Debug.Assert(stateObj._pendingData || !dataReady, "dataReady is set, but there is no pending data");
}
示例2: Run
//.........这里部分代码省略.........
if (this._connHandler != null)
{
connection = this._connHandler.Connection;
}
if (((connection != null) && connection.FireInfoMessageEventOnUserErrors) && (error.Class <= 0x10))
{
this.FireInfoMessageEvent(connection, stateObj, error);
}
else if (error.Class < 11)
{
this.Warnings.Add(error);
}
else if (error.Class < 20)
{
this.Errors.Add(error);
if ((dataStream != null) && !dataStream.IsInitialized)
{
runBehavior = RunBehavior.UntilDone;
}
}
else
{
this.Errors.Add(error);
runBehavior = RunBehavior.UntilDone;
}
}
goto Label_06D5;
}
case 0xac:
{
SqlReturnValue rec = this.ProcessReturnValue(tokenLength, stateObj);
if (cmdHandler != null)
{
cmdHandler.OnReturnValue(rec);
}
goto Label_06D5;
}
case 0xad:
{
SqlLoginAck ack = this.ProcessLoginAck(stateObj);
this._connHandler.OnLoginAck(ack);
goto Label_06D5;
}
case 0x88:
{
if (stateObj._cleanupAltMetaDataSetArray == null)
{
stateObj._cleanupAltMetaDataSetArray = new _SqlMetaDataSetCollection();
}
_SqlMetaDataSet altMetaDataSet = this.ProcessAltMetaData(tokenLength, stateObj);
stateObj._cleanupAltMetaDataSetArray.SetAltMetaData(altMetaDataSet);
if (dataStream != null)
{
dataStream.SetAltMetaDataSet(altMetaDataSet, 0x88 != stateObj.PeekByte());
}
goto Label_06D5;
}
case 0x79:
{
int status = stateObj.ReadInt32();
if (cmdHandler != null)
{
cmdHandler.OnReturnStatus(status);
}
goto Label_06D5;
}