protected void Stor_Click(object sender, EventArgs e) { string s1 = "p1"; DataTable dt = new DataTable(); dt.Columns.Add("UID"); dt.Columns.Add("Name"); con.Open(); foreach (GridViewRow item in GridView1.Rows) { if ((item.Cells[0].FindControl("CheckBox1") as CheckBox).Checked) { DataRow dr = dt.NewRow(); dr["UID"] = item.Cells[0].Text; dr["Name"] = item.Cells[1].Text; dt.Rows.Add(dr); Response.Write(dr["UID"].ToString()); Response.Write(dr["Name"].ToString()); int t1 = Convert.ToInt32(dr["UID"].ToString()); string query = "Update Attendence1 set Status='" + s1 + "' where UID=" + t1 + ""; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)