foreach (GridViewRow gr in GridView1.Rows)
{
CheckBox chk = (CheckBox)gr.FindControl("CheckBox1");
if (chk.Checked == true)
{
// string sno = (CheckBox)gr.FindControl("CheckBox1");
Label Label3 = (Label)gr.FindControl("Label3");
// int ItemValue = int.Parse(sno);
// string iteemval = Label3.Text;
centers filgrd = new centers();
DAL dl = new DAL();
SqlConnection cn = dl.Getconnection();
SqlCommand cmd = new SqlCommand("Delete * from Student_details where sno="+Label3.Text+"",cn);
cn.Open();
try
{
cmd.ExecuteNonQuery();
// Page.RegisterStartupScript("aa", "");
DataSet ds = filgrd.get_studenet(DropDownList4.SelectedIndex, DropDownList2.SelectedIndex, DropDownList3.SelectedIndex);
GridView1.DataSource = ds;
GridView1.DataBind();
Label2.Text = "No Records Found..";
}
catch (Exception ex)
{
}
finally
{
cn.Close();
}
}
Saturday, December 6, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment