Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlBinary.Item Property

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 byte this[
	int index
] { get; }

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.

ExceptionCondition
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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft