更新表数据出错?

xianghai 2005-04-06 01:49:51
情况如下:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.

源错误:


行 133: ds1.Tables["xt"].Rows[0][1]=50000000;
行 134: //ds1.Tables["Govdutylog"].Rows[0][4]=DateTime.Now;
行 135: Rsadp1.Update(ds1,"xt");

不知道是什么原因了,我换成以前建的表是可以更新的,但新建的表更新都不行,只能插入。为什么?请大家帮助一下,谢谢。
...全文
40 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
凨叔 2005-04-06
  • 打赏
  • 举报
回复
Update的表没有主键或唯一键,你最好是加上主键或唯一键。

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧