次の方法で共有


SqlBinary.Item[Int32] プロパティ

定義

整数パラメーターindexで示される位置にあるValue プロパティから 1 バイトを取得します。 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 プロパティを調べます。

適用対象

こちらもご覧ください