遍历datagrid……
刚好我再做一个同样的东西,不过我要获取的不是checkboxlist的值,而是input text的值,不过差不多了,你参考参考吧,还有就是你应该是用03吧,我的05,所以是gridview,不过一样的……
foreach (GridViewRow row in GridView1.Rows)
{
string WorkNo = row.Cells[0].Text.ToString();
string WorkName = row.Cells[1].Text.ToString();
HtmlInputControl CardValue = (HtmlInputControl)row.FindControl("SufficientText");
double SufficientValue = Convert.ToDouble(CardValue.Value.ToString());
string CardNo = row.Cells[2].Text.ToString();
string SufficientSql = "insert into CashManage(workid,workername,virtualmoney,departmentname,derection,zhaiyao,[type],[departmentid],[card],[updatedata])values('" + WorkNo + "','" + WorkName + "'," + SufficientValue + ",'" + dptName + "','借','充值','充值'," + dptId + ",'" + CardNo + "','" + DateTime.Now.ToString() + "')";
if (obj.ExecSQL(SufficientSql) == false)
{
Response.Write("<script language=javascript>alert('" + WorkName + " 充值失败!');</script>");
}
}