给dataTable增加一列的正确写法Sum(Convert(bgoodsqty,'System.Int32'))??

wyfwyf2000 2003-05-19 10:21:12
我分两条语句写正确,但合在一起出错了ds.Tables[0].Columns.Add("IntQyt", typeof(Int32), "Sum(Convert(bgoodsqty,'System.Int32'))");
...全文
154 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tuzi98 2003-05-19
  • 打赏
  • 举报
回复
你应该这样用
this.dataSet11.Tables[0].Columns.Add(new DataColumn("IntQyt",Type.GetType("System.Int32"),"Convert(Sum(bgoodsqty), 'System.Int32')"));
wyfwyf2000 2003-05-19
  • 打赏
  • 举报
回复
up
coollzh 2003-05-19
  • 打赏
  • 举报
回复
Convert(bgoodsqty,'System.Int32')
sql的convert不能这么用把,应用CONVERT(int,bgoodsqty)

110,546

社区成员

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

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

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