开发者

Update requires a valid DeleteCommand when passed DataRow collection with deleted rows

While trying to delete the data from my SQL Server CE 3.5 database, I am getting error:

Update requires a valid DeleteCommand when passed DataRow collection with deleted rows"

While it is ok with Access dat开发者_C百科abase.

Please advise. Thanks!


That how I fixed it:

  1. In my SQL set Primary Key
  2. In SQL Server Object Explorer find your table, ensure same column has set a primary key
  3. In Solution Explorer, right click your DataSet, View Designer, ensure your table same column set a primary key
  4. save all, must ensure all are saved!
  5. rebuild, done.


I browsed through several forums and found that we need to follow following to get rid of this error: 1) Add a field in database, say PK, 2) Data Type Bigint, then set Primary Key property to Yes In the lower grid you will see Identity filed getting enabled. By default it is False. 3) Make it True.
4) IdentityIncrement and IdentitySeed should contain the value 1

The error shall be resolved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜