Datatable default values

  • Thread starter Thread starter Vik
  • Start date Start date
V

Vik

I use a dataadapter to create a datatable and retrieve/update data in SQL
Server database. But the datatable does not receive the default values from
a server table and the new records don't receive the defaults values.
What may be wrong here?

Thanks.
 
No, dataadapter only retrieves data and Column data type for you. If you need
set Column properties, such as DefaultValue, AutoIncrement, and so on, you
have to manually set them, e.g.

datatable.Columns["QTY"].DefaultValue = 0;

HTH

Elton Wang
 
Back
Top