Helo, i want to update Gridview Asp.net using C# Date not Updated please Help
///Gridview///
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating" onrowupdated="GridView1_RowUpdated">
///GridView Updating Code///
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
String ID = GridView1.Rows[e.RowIndex].Cells[0].Text;
String ClassName = GridView1.Rows[e.RowIndex].Cells[1].Text;
obj.con.Open();
obj.qry = "update Classreg set ClassName=@ClassName where ID=@ID";
obj.cmd = new SqlCommand(obj.qry, obj.con);
obj.cmd.Parameters.AddWithValue("ClassName", TextBox2.Text);
obj.cmd.Parameters.AddWithValue("ID", TextBox1.Text);
obj.cmd.ExecuteNonQuery();
obj.con.Close();
Response.Write(@"");
filldata();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
filldata();
}

Amit GuptaRank #190 · 12.8K reputationPosted Feb 26, 2017, 11:45 PM EST
Rafnas T PRank #280 · 8.8K reputationPosted Feb 27, 2017, 12:36 AM EST
Posted Feb 27, 2017, 12:05 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Feb 27, 2017, 12:10 AM EST
Posted Feb 27, 2017, 1:43 AM EST
Rafnas T PRank #280 · 8.8K reputationPosted Feb 27, 2017, 2:00 AM EST
Posted Feb 27, 2017, 3:33 AM EST