ADO.NET tableadapter add/update/delete
I'm using the table adapter in C# where visual studio generates the code for you. I have inserts and updates working just fine using the following code.
However when trying to d开发者_StackOverflow中文版elete using the .update it gives me the following error.
Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.
this.workersTableAdapter.Update(this.nursery_dbDataSet_workers.workers);
Open the DataSet designer and click on the Adapter. In the properties windows it has 4 Command properties, check the DeleteCommand. It seems to be missing.
You cam rerun the wizard or write the Delete Sql by hand.
精彩评论