V
Viorel
Adding new row with default values.
In order to insert programmatically a new row into a database table, without
direct "INSERT INTO" SQL statement, I use the well-known DataTable.NewRow,
DataTable.Rows.Add and DataAdapter.Update member functions. Before adding
the new row object to the Rows collection, all of the row's fields that do
not accept NULL must be assigned, otherwise an exception is thrown. However,
I do not want to assign values to some of the fields, because they already
have default values, defined using "Design Table" dialog. So, how can I tell
the system "Please use default values for unassigned fields while inserting
this new row"?
Thanks.
Viorel.
In order to insert programmatically a new row into a database table, without
direct "INSERT INTO" SQL statement, I use the well-known DataTable.NewRow,
DataTable.Rows.Add and DataAdapter.Update member functions. Before adding
the new row object to the Rows collection, all of the row's fields that do
not accept NULL must be assigned, otherwise an exception is thrown. However,
I do not want to assign values to some of the fields, because they already
have default values, defined using "Design Table" dialog. So, how can I tell
the system "Please use default values for unassigned fields while inserting
this new row"?
Thanks.
Viorel.