通过


SqlBinary.Item[Int32] 属性

定义

获取位于 Value 整数参数 index指示的位置的属性中的单个字节。 如果 index 指示字节数组末尾之外的位置,将引发一个 SqlNullValueException 位置。 此属性为只读。

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

要检索的字节的位置。

属性值

位于整数参数指示的位置的字节。

例外

当属性包含时 Value 读取该属性 Null

-或-

index 参数指示超出字节数组长度的位置,如属性指示 Length

注解

为了避免引发, SqlNullValueException在读取此属性之前,请始终检查 IsNull 属性和 Length 属性。

适用于

另请参阅