SqlBinary::Item Property (Int32)

 

Gets the single byte from the Value property located at the position indicated by the integer parameter, index. If index indicates a position beyond the end of the byte array, a SqlNullValueException will be raised. This property is read-only.

Namespace:   System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)

public:
property unsigned char default[
	int index
] {
	unsigned char get(int index);
}

Parameters

index
Type: System::Int32

The position of the byte to be retrieved.

Property Value

Type: System::Byte

The byte located at the position indicated by the integer parameter.

Exception Condition
SqlNullValueException

The property is read when the Value property contains Null

- or -

The index parameter indicates a position byond the length of the byte array as indicated by the Length property.

To avoid raising a SqlNullValueException, always examine the IsNull property and the Length property before reading this property.

.NET Framework
Available since 1.1
Return to top
Show: