Datatable default values

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top