有关DataGrid数据定位的问题 通过sql来定位阿你的两个table总归有一个联系的关键字段吧。你可以将这个更新的过程放入存储过程不懂的可以继续问。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 两个表是没有关系的,这是我写的SQLstrsqlup="Update kc set bz=bz-'"+((TextBox)e.Item.Cells[6].Controls[0]).Text+"' Wherebh='"+((TextBox)e.Item.Cells[2].Controls[0]).Text+"'"无法执行,提示:指定的参数已超出有效值的范围。参数名:index 有例子最好 你先分开测试一下确保你的(TextBox)e.Item.Cells[6].Controls[0]).Text(TextBox)e.Item.Cells[2].Controls[0]).Text没有问题 for (int i=1;i<=DgBMMX.Items.Count;i++){string strsqlupdate="update kc set bz=bz-@bz where cpph='"+TxtCPPH+"' and bh=@bh";OleDbCommand comm1=new OleDbCommand(strsqlupdate,cn);comm1.Parameters.Add(new OleDbParameter("@bz",OleDbType.Single));comm1.Parameters.Add(new OleDbParameter("@bh",OleDbType.Char,10));string col=((TextBox)DgBMMX.Items[i].FindControl("txtbz")).Text;comm1.Parameters["@bz"].Value=col;col=((TextBox)DgBMMX.Items[i].FindControl("txtbh")).Text;comm1.Parameters["@bh"].Value=col;comm1.ExecuteNonQuery();}提示:索引超出范围。必须为非负值并小于集合大小。参数名:index 接口继承问题?? 求Asp.net中同一用户最新登录踢掉历史登录源码实例 treeview异步 请教一个关于查找的问题 asp.net查询access数据库 请帮忙做做这份试卷 怎样将读出来的系统时间写到数据库中 借人气问:PhotoShop怎样从.jpg图像中截取一个圆形部分?在线等! 求条sql语句 高分请教 .net安装问题 在ASP.NET中,我想处理一表单,怎么做?是不是象以前那样,提交给另一个文件处理,还是写在自己的CS文件里? 如何将dataset存为excel以供web form 下载?
strsqlup="Update kc set bz=bz-'"+((TextBox)e.Item.Cells[6].Controls[0]).Text+"' Wherebh='"+((TextBox)e.Item.Cells[2].Controls[0]).Text+"'"
无法执行,提示:指定的参数已超出有效值的范围。参数名:index
有例子最好
确保你的
(TextBox)e.Item.Cells[6].Controls[0]).Text
(TextBox)e.Item.Cells[2].Controls[0]).Text
没有问题
{
string strsqlupdate="update kc set bz=bz-@bz where cpph='"+TxtCPPH+"' and bh=@bh";
OleDbCommand comm1=new OleDbCommand(strsqlupdate,cn);
comm1.Parameters.Add(new OleDbParameter("@bz",OleDbType.Single));
comm1.Parameters.Add(new OleDbParameter("@bh",OleDbType.Char,10));
string col=((TextBox)DgBMMX.Items[i].FindControl("txtbz")).Text;
comm1.Parameters["@bz"].Value=col;
col=((TextBox)DgBMMX.Items[i].FindControl("txtbh")).Text;
comm1.Parameters["@bh"].Value=col;
comm1.ExecuteNonQuery();
}
提示:索引超出范围。必须为非负值并小于集合大小。参数名:index