DataRowCollection::Add Method (array<Object^>^)
.NET Framework (current version)
Creates a row using specified values and adds it to the DataRowCollection.
Assembly: System.Data (in System.Data.dll)
Parameters
- values
-
Type:
array<System::Object^>^
The array of values that are used to create the new row.
| Exception | Condition |
|---|---|
| ArgumentException | The array is larger than the number of columns in the table. |
| InvalidCastException | A value does not match its respective column type. |
| ConstraintException | Adding the row invalidates a constraint. |
| NoNullAllowedException | Trying to put a null in a column where AllowDBNull is false. |
If a DataColumn object has its AutoIncrement set to True, null should be passed to get the default value for that column.
Exceptions can also occur if you generate an exception during either a ColumnChanging or RowChanging event. If an exception occurs, the row is not added to the table.
.NET Framework
Available since 1.1
Available since 1.1
Show: