System.Data.SqlClient.TdsParser.TryGetDataLength C# (CSharp) Method

TryGetDataLength() private method

private TryGetDataLength ( SqlMetaDataPriv colmeta, System.Data.SqlClient.TdsParserStateObject stateObj, ulong &length ) : bool
colmeta SqlMetaDataPriv
stateObj System.Data.SqlClient.TdsParserStateObject
length ulong
return bool
        internal bool TryGetDataLength(SqlMetaDataPriv colmeta, TdsParserStateObject stateObj, out ulong length)
        {
            // Handle Yukon specific tokens
            if (colmeta.metaType.IsPlp)
            {
                Debug.Assert(colmeta.tdsType == TdsEnums.SQLXMLTYPE ||
                             colmeta.tdsType == TdsEnums.SQLBIGVARCHAR ||
                             colmeta.tdsType == TdsEnums.SQLBIGVARBINARY ||
                             colmeta.tdsType == TdsEnums.SQLNVARCHAR ||
                             // Large UDTs is WinFS-only
                             colmeta.tdsType == TdsEnums.SQLUDT,
                             "GetDataLength:Invalid streaming datatype");
                return stateObj.TryReadPlpLength(true, out length);
            }
            else
            {
                int intLength;
                if (!TryGetTokenLength(colmeta.tdsType, stateObj, out intLength))
                {
                    length = 0;
                    return false;
                }
                length = (ulong)intLength;
                return true;
            }
        }
TdsParser