求帮助,

浮生_1997 2016-11-21 10:51:04
这是我在网上看别人的代码,到我这里就提示 未将对象引用设置到对象的实例 public static void DataGridCount(DataGridView datagd, int dgrindex, int dgrindex1, int dgrindex2) {if (!DBNull.Value.Equals(datagd.CurrentRow.Cells[dgrindex1].Value) & !DBNull.Value.Equals(datagd.CurrentRow.Cells[dgrindex2].Value)) {datagd.CurrentRow.Cells[dgrindex].Value = Convert.ToSingle(datagd.CurrentRow.Cells[dgrindex1].Value) * Convert.ToInt32(datagd.CurrentRow.Cells[dgrindex1].Value); }} 引用 DataGridCount(DGRep, 4, 2, 3); 或者有人帮我弄一下sql语句,我sql sever 中的数据是decimal(18,4)=int*decimal(18,2)我一添加这个就不显示数据了。不知道为什么
...全文
88 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
浮生_1997 2016-11-22
  • 打赏
  • 举报
回复
引用 2 楼 caozhy的回复:
调试下,是不是数组为空nothing
没有啊,我这两个列的值都有数据的
threenewbee 2016-11-21
  • 打赏
  • 举报
回复
调试下,是不是数组为空nothing
浮生_1997 2016-11-21
  • 打赏
  • 举报
回复
我的目的是。datagridview中一个列的值为另外两个列的值的积

110,532

社区成员

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

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

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