Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataRow::ItemArray Property

 

Gets or sets all the values for this row through an array.

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

public:
property array<Object^>^ ItemArray {
	array<Object^>^ get();
	void set(array<Object^>^ value);
}

Property Value

Type: array<System::Object^>^

An array of type Object.

Exception Condition
ArgumentException

The array is larger than the number of columns in the table.

InvalidCastException

A value in the array does not match its DataType in its respective DataColumn.

ConstraintException

An edit broke a constraint.

ReadOnlyException

An edit tried to change the value of a read-only column.

NoNullAllowedException

An edit tried to put a null value in a column where AllowDBNull of the DataColumn object is false.

DeletedRowInaccessibleException

The row has been deleted.

You can use this property to set or get values for this row through an array. If you use this property to set values, the array must have the same size and ordering as the column collection. Passing null in the ItemArray indicates that no value was specified.

Users can generate exceptions in the ColumnChanging event or the RowChanging event.

The following examples show how to get and set values using the ItemArray property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft