Hi Scott,
Use DataRow.Delete instead of Remove[At].
The difference is that Remove[At] removes row from collection, while Delete
marks is as Deleted and it is picked by Update for deleting.
And don't call AcceptChanges before Update. Actually you don't have to call
AcceptChanges at all in your scenario.
(AcceptChanges consolidates RowState of all rows to Unchanged).
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group
www.codezone-si.info
"Scott" <(E-Mail Removed)> wrote in message
news:953A3FC0-1599-4150-9A9E-(E-Mail Removed)...
> Hi all,
>
> I am using the following to remove a row from a DataSet:
> myDataSet.Tables["Table1"].Rows.RemoveAt(indexSelected);
>
> followed by;
> myDataAdapter.Update(myDataSet);
>
> After this call, looking in the database, the row is not deleted. But
> debugging it I can see it remove the row.
>
> Also note that the following insert does insert into the database:
> myDataSet.Tables["Table1"].Rows.InsertAt(newRow, index);
>
> Strange how InsertAt works but not RemoveAt.
>
> Does anyone knows what the problem is????
>
> Thanks for any help,
> Scott