datatable是用inner join 与select orderid as stroid这两种方式得到的,这时如何用CommandBuild提交更新?

iyaozg 2003-11-21 09:52:40
SqlDataAdapter custDA = new SqlDataAdapter("select * from order R inner join detail D on R.id=D.id", nwindConn);
SqlCommandBuilder custCB = new SqlCommandBuilder(custDA);

DataSet custDS = new DataSet();

nwindConn.Open();
custDA.Fill(custDS, "Customers");

// Code to modify data in the DataSet here.

custDA.Update(custDS, "order");

这种写法在提交Update()时,好象不行?
...全文
88 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
vivianxu 2003-11-28
  • 打赏
  • 举报
回复
我也碰到这个问题,哪位高手帮忙看一下
iyaozg 2003-11-21
  • 打赏
  • 举报
回复
1
iyaozg 2003-11-21
  • 打赏
  • 举报
回复
帮忙看一下
iyaozg 2003-11-21
  • 打赏
  • 举报
回复
这是笔误,但是我用custCB.GetUpdateCommand().CommandText时提示"对于多个基表不支持动态 SQL 生成"
HNU 2003-11-21
  • 打赏
  • 举报
回复
过程没问题,但是你 Fill 的是"Customers",为什么Update 的是"order" ?
iyaozg 2003-11-21
  • 打赏
  • 举报
回复
谁来帮我看一下

111,119

社区成员

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

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

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