I have some code that adds records to a database but it is quite common for there to be a lot of duplicate records. I am trying to write some code that will remove the duplicate rows in the database table. I am using table adapters for this task, i have the following code written that produces a table without the duplicate rows but i do not know how to update the database table with the results,
AddDetailsTableAdapter detailsAdapter = new AddDetailsTableAdapter();
DataTable dTable = new DataTable();
dTable = detailsAdapter.GetData();
DataView dv = new DataView(dTable);
string[] strColumns = { "DepotNo", "Route", "Add1", "Add2", "Add3",
"Add4", "Add5", "Postcode" };
dTable = dv.ToTable(true, strColumns);
detailsAdapter.Update(dTable);
The line 'detailsAdapter.Update(dTable)' will not compile.
How do i update the database table with the dTable result??
Any help is much appreciated.
Thanks