说我GridViewRow 里不能用带[]的索引!
那要怎么做啊,怎么改啊! 哭!
foreach (GridViewRow dr in GridView1.Rows)
{
chk = (CheckBox)dr.FindControl("checkboxname");
if (chk.Checked)
{
int QTY = Convert.ToInt32(dr[4].ToString());
string PRD_NO = dr[2].ToString();
string PRD_NAME = dr[3].ToString();
string BO_NO = _BO_NO;
string insertSQL = "insert into OP_Prdt_Borrow(BO_NO,Prdt_NO) vaules('" + BO_NO + "','" + PRD_NO + "')";
link.ExcuteDataBase(insertSQL); }
那要怎么做啊,怎么改啊! 哭!
foreach (GridViewRow dr in GridView1.Rows)
{
chk = (CheckBox)dr.FindControl("checkboxname");
if (chk.Checked)
{
int QTY = Convert.ToInt32(dr[4].ToString());
string PRD_NO = dr[2].ToString();
string PRD_NAME = dr[3].ToString();
string BO_NO = _BO_NO;
string insertSQL = "insert into OP_Prdt_Borrow(BO_NO,Prdt_NO) vaules('" + BO_NO + "','" + PRD_NO + "')";
link.ExcuteDataBase(insertSQL); }
解决方案 »
- 如何使自定义控件获得焦点时产生一个虚框,失去焦点时,虚框自动消失?
- MVC 上传图片有些细节问题,请指教
- asp.net gridview分页出现Error:缺少对象..在线等
- 只用SELECT语句操作数据库 的问题
- 从ajax到ajaxpro转移时,出现了问题
- formview控件中的控件取值的问题
- asp.net “未能在视图中打开,在<% %>块中,以不同方式将值括起来。” 的问题求助
- 为何有了ItemCommand事件后无法实现DataGrid自带的分页了呢??
- 简单问题 语句出错,在线等,急
- 怎样实现登录后,又重新回到登录页
- 老大提出了需要掌握的一些基本技能,不知道如何下手,请指教
- 这样实现优先级?
string _BO_NO = year + month + day + Number;
foreach (GridViewRow dr in GridView1.Rows)
{
chk = (CheckBox)dr.FindControl("checkboxname");
if (chk.Checked)
{
int QTY = Convert.ToInt32(dr.Cells[4].ToString());
string PRD_NO = dr.Cells[2].ToString();
string PRD_NAME = dr.Cells[3].ToString();
string BO_NO = _BO_NO;
string insertSQL = "insert into OP_Prdt_Borrow(BO_NO,Prdt_NO) vaules('" + BO_NO + "','" + PRD_NO + "')";
link.ExcuteDataBase(insertSQL); }
在 if (chk.Checked) 这里过不去!
$exception {"未将对象引用设置到对象的实例。"} System.Exception {System.NullReferenceException}
这要怎么处理啊!