SqlBinary.Item[Int32] 属性

定义

Value 属性获取单字节,该属性位于整数参数 index 指示的位置。Gets the single byte from the Value property located at the position indicated by the integer parameter, index. 如果 index 指示位置位于字节数组的结尾以外,将引发 SqlNullValueExceptionIf index indicates a position beyond the end of the byte array, a SqlNullValueException will be raised. 此属性为只读。This property is read-only.

public:
 property System::Byte default[int] { System::Byte get(int index); };
public byte this[int index] { get; }
member this.Item(int) : byte
Default Public ReadOnly Property Item(index As Integer) As Byte

参数

index
Int32

要检索的字节的位置。The position of the byte to be retrieved.

属性值

Byte

位于整数参数指示的位置的字节。The byte located at the position indicated by the integer parameter.

例外

Value 属性包含 Null 时,读取该属性。The property is read when the Value property contains Null

- 或 --or- index 参数指示超过字节数组长度(由 Length 属性指示)的位置。The index parameter indicates a position beyond the length of the byte array as indicated by the Length property.

注解

若要避免引发 SqlNullValueException ,请 IsNull Length 在读取此属性之前始终检查属性和属性。To avoid raising a SqlNullValueException, always examine the IsNull property and the Length property before reading this property.

适用于