foreach (ListViewDataItem item in this.LstvCollegeCode.Items) { if (item.ItemType == ListViewItemType.DataItem) { CheckBox chkbCollegeCode = item.FindControl("chkbCollegeCode") as CheckBox; if (chkbCollegeCode.Checked == true) { foreach (ListViewDataItem item1 in this.lstvCenterCode.Items) { CheckBox chkbCenterName = item.FindControl("chkbCenterName") as CheckBox; if (chkbCenterName.Checked == true) { foreach (ListViewDataItem item2 in this.lstvCourse.Items) { CheckBox chkbCourse = item.FindControl("chkbCourse") as CheckBox; if (chkbCourse.Checked == true) { SqlCommand cmd = new SqlCommand(); cmd = new SqlCommand("update HTStudentinfo set CenterCode='" + chkbCollegeCode + "',CenterName='" + chkbCollegeCode + "' where CollCode='" + chkbCollegeCode + "' and Course='" + chkbCourse.Text + "' ", con); DataSet ds = new DataSet(); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); grdPrepare.DataSource = ds; grdPrepare.DataBind(); }
pre
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)