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

TryReadSqlDecimal() private method

private TryReadSqlDecimal ( SqlBuffer value, int length, byte precision, byte scale, System.Data.SqlClient.TdsParserStateObject stateObj ) : bool
value SqlBuffer
length int
precision byte
scale byte
stateObj System.Data.SqlClient.TdsParserStateObject
return bool
        private bool TryReadSqlDecimal(SqlBuffer value, int length, byte precision, byte scale, TdsParserStateObject stateObj)
        {
            byte byteValue;
            if (!stateObj.TryReadByte(out byteValue))
            {
                return false;
            }
            bool fPositive = (1 == byteValue);

            length = checked((int)length - 1);

            int[] bits;
            if (!TryReadDecimalBits(length, stateObj, out bits))
            {
                return false;
            }

            value.SetToDecimal(precision, scale, fPositive, bits);
            return true;
        }
TdsParser