DataGrid and autoincrement

G

Guest

I have a datagrid that looks at a dataset that I manually fill from a remote
database.
My first column is auto incremented. When I populate the dataset from the
remote database the datagrid shows everything that I want it to. The problem
is that when I clear the datatable(datatable1.clear) and repopulate the
database the autoincrement column starts at the last number that was in the
datagrid before I cleared it.
Any suggestions.

Thanks,
DCSTech
 
W

W.G. Ryan eMVP

The DataColumn has a Autoincrement property as well as a .AutoIncrementSeed
property htat you can specify - set it to 0 before refilling it and it'll
start over at 0
 

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

Similar Threads

clearing a datagrid 1
About autoincrement 1
Autoincrement / Rowstate Problem 1
Datatable clear 4
AutoIncrement Key 1
ADO.NET and Autoincrement columns 6
Reset AutoIncrement value 6
Dummy column in datagrid 2

Top