本文整理汇总了C#中System.Data.SqlClient.SqlBuffer.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# SqlBuffer.Clear方法的具体用法?C# SqlBuffer.Clear怎么用?C# SqlBuffer.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlBuffer
的用法示例。
在下文中一共展示了SqlBuffer.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryProcessRow
// Used internally by BulkCopy only
private bool TryProcessRow(_SqlMetaDataSet columns, object[] buffer, int[] map, TdsParserStateObject stateObj)
{
SqlBuffer data = new SqlBuffer();
for (int i = 0; i < columns.Length; i++)
{
_SqlMetaData md = columns[i];
Debug.Assert(md != null, "_SqlMetaData should not be null for column " + i.ToString(CultureInfo.InvariantCulture));
bool isNull;
ulong len;
if (!TryProcessColumnHeader(md, stateObj, i, out isNull, out len))
{
return false;
}
if (isNull)
{
GetNullSqlValue(data, md);
buffer[map[i]] = data.SqlValue;
}
else
{
// We only read up to 2Gb. Throw if data is larger. Very large data
// should be read in chunks in sequential read mode
// For Plp columns, we may have gotten only the length of the first chunk
if (!TryReadSqlValue(data, md, md.metaType.IsPlp ? (Int32.MaxValue) : (int)len, stateObj))
{
return false;
}
buffer[map[i]] = data.SqlValue;
if (stateObj._longlen != 0)
{
throw new SqlTruncateException(Res.GetString(Res.SqlMisc_TruncationMaxDataMessage));
}
}
data.Clear();
}
return true;
}
示例2: ProcessRow
private void ProcessRow(_SqlMetaDataSet columns, object[] buffer, int[] map, TdsParserStateObject stateObj)
{
SqlBuffer nullVal = new SqlBuffer();
for (int i = 0; i < columns.Length; i++)
{
bool flag;
_SqlMetaData col = columns[i];
ulong num2 = this.ProcessColumnHeader(col, stateObj, out flag);
if (flag)
{
this.GetNullSqlValue(nullVal, col);
buffer[map[i]] = nullVal.SqlValue;
}
else
{
this.ReadSqlValue(nullVal, col, col.metaType.IsPlp ? 0x7fffffff : ((int) num2), stateObj);
buffer[map[i]] = nullVal.SqlValue;
if (stateObj._longlen != 0L)
{
throw new SqlTruncateException(System.Data.Res.GetString("SqlMisc_TruncationMaxDataMessage"));
}
}
nullVal.Clear();
}
}