I am getting a concurrency violation on my updatecommand when I try to save a datatable back to the database. I am changing one column in about 90% of my rows in a 4200 plus row datatable. I am using a datatable that has a primarykey. I am also using a sqlitedatadapter.
I Your help would be appreciated
What I have tried:
fill the datatable with this:
<pre>sql = "SELECT * FROM Customers WHERE Status = 'Active'"
ActiveCustomersAdapter = New SQLiteDataAdapter(sql, conn)
I fill the table, loop through the table changing one date field by adding an increment variable to a date column and then try to save back to the database with:
Dim cbActiveCustomers As New SQLiteCommandBuilder(ActiveCustomersAdapter)
conn.Open() ... forgot to show this
conn.Close() ... and this thanks MadMyche
There are no concurrent users and no other activity on the database. I am obviously not doing something correctly but have not found what I am missing.
I have searched concurrency issues but most explain issues that do not specifically relate. I have stripped the project back to doing nothing but:
1. open the database and fill the datatable
2. modify the field in about 90% of the tables rows
3. save the table back to the database