本文整理汇总了C#中System.Data.SqlClient.TdsParserStateObject.TryStartNewRow方法的典型用法代码示例。如果您正苦于以下问题:C# TdsParserStateObject.TryStartNewRow方法的具体用法?C# TdsParserStateObject.TryStartNewRow怎么用?C# TdsParserStateObject.TryStartNewRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.TdsParserStateObject
的用法示例。
在下文中一共展示了TdsParserStateObject.TryStartNewRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryGetAltRowId
// assumes that the current position is at the start of an altrow!
internal bool TryGetAltRowId(TdsParserStateObject stateObj, out int id)
{
byte token;
if (!stateObj.TryReadByte(out token))
{ // skip over ALTROW token
id = 0;
return false;
}
Debug.Assert((token == TdsEnums.SQLALTROW), "");
// Start a fresh row - disable NBC since Alt Rows are never compressed
if (!stateObj.TryStartNewRow(isNullCompressed: false))
{
id = 0;
return false;
}
ushort shortId;
if (!stateObj.TryReadUInt16(out shortId))
{
id = 0;
return false;
}
id = shortId;
return true;
}
示例2: TryRun
//.........这里部分代码省略.........
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);
if (null != dataStream)
{
byte metadataConsumedByte;
if (!stateObj.TryPeekByte(out metadataConsumedByte))
{
return false;
}
if (!dataStream.TrySetAltMetaDataSet(cleanupAltMetaDataSet, (TdsEnums.SQLALTMETADATA != metadataConsumedByte)))
{
return false;
}
}
break;
}
case TdsEnums.SQLALTROW:
{
if (!stateObj.TryStartNewRow(isNullCompressed: false))
{ // altrows are not currently null compressed
return false;
}
// read will call run until dataReady. Must not read any data if returnimmetiately set
if (RunBehavior.ReturnImmediately != (RunBehavior.ReturnImmediately & runBehavior))
{
ushort altRowId;
if (!stateObj.TryReadUInt16(out altRowId))
{ // get altRowId
return false;
}
if (!TrySkipRow(stateObj._cleanupAltMetaDataSetArray.GetAltMetaData(altRowId), stateObj))
{ // skip altRow
return false;
}
}
else
{
dataReady = true;
}
break;
}
case TdsEnums.SQLENVCHANGE:
{
// ENVCHANGE must be processed synchronously (since it can modify the state of many objects)
stateObj._syncOverAsync = true;
SqlEnvChange[] env;