Error : Update requires a valid UpdateCommand when passed DataRow collection with modified rows

后端 未结 4 2194
孤独总比滥情好
孤独总比滥情好 2020-12-21 01:20

I am using Paging to show data in datagridview, but when i try to Update any data with updatebutton data should be updated In datagridview

4条回答
  •  醉梦人生
    2020-12-21 02:22

    I had to alter my (incrementing) index column to the primary key of my table (as Eaint suggest). After this, I had to pull up the DataSet.xsd in designer view, right click on the visual DataTable object and select configure. When the TableAdapter Configuration Wizard opened, I clicked the Advanced Options button. I checked the Generate Insert, Update and Delete statements checkbox then OK and Finish. After this (still in designer view), I selected the visual TableAdapter object which gave me all the full properties. The SQL was autogenerated. Took a while for me to track this down, so I hope it helps someone.

提交回复
热议问题