Michael
Michael

Reputation: 13616

InsertAt() method doesn't update SQL table

I use this line:

DataSet.SomeTableName.Rows.InsertAt(someRow, 0);

After this line I update my SQL table. But the inserted row does not appear on the SQL server side.

Any idea why the inserted row doesn't appear on the SQL server side?

Upvotes: 1

Views: 98

Answers (1)

Mike Perrenoud
Mike Perrenoud

Reputation: 67898

Issue the SetAdded method:

someRow.AcceptChanges();
someRow.SetAdded();

as far as I know InsertAt doesn't actually perform the RowState modifications.

Upvotes: 1

Related Questions