protected void gridStud_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
LinkButton btn = (LinkButton)gridStud.Rows[e.RowIndex].FindControl("linkUpdate");
int studentId = Convert.ToInt32(gridStud.DataKeys[e.RowIndex].Value.ToString());
TextBox txtStudName = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtStud");
RadioButton rd1 = (RadioButton)gridStud.Rows[e.RowIndex].FindControl("RadioButton3");
RadioButton rd2 = (RadioButton)gridStud.Rows[e.RowIndex].FindControl("RadioButton4");
TextBox txtBirthdate = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtDate");
TextBox txtEmail = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtEmail");
TextBox txtMobile = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtmob");
studentCommon c = new studentCommon();
SqlCommand cmd = new SqlCommand("studIUD");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("StatementType", "UPDATE");
// cmd.Parameters.AddWithValue("studentId", studentId);
cmd.Parameters.AddWithValue("name", txtStudName);
if (rd1.Checked)
{
cmd.Parameters.AddWithValue("gender", "Male");
}
else
{
cmd.Parameters.AddWithValue("gender", "Female");
}
cmd.Parameters.AddWithValue("brithDate", txtBirthdate);
cmd.Parameters.AddWithValue("emailid", txtEmail);
cmd.Parameters.AddWithValue("mobilenumber", txtMobile);
c.ExecuteNonQueryByCommand(cmd);
gridStud.EditIndex = -1;
gridStud.DataBind();
}

Laxmidhar SahooRank #383 · 6.6K reputationPosted Feb 28, 2018, 4:55 AM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Feb 28, 2018, 4:57 AM EST
Rajneesh ChaubeyRank #1,073 · 1.8K reputationPosted Feb 28, 2018, 7:13 AM EST
Dhimesh Parmar132 reputationPosted Mar 1, 2018, 4:10 PM EST
Rajneesh ChaubeyRank #1,073 · 1.8K reputationPosted Mar 1, 2018, 7:55 PM EST
Dhimesh Parmar132 reputationPosted Mar 1, 2018, 10:41 PM EST
Rajneesh ChaubeyRank #1,073 · 1.8K reputationPosted Mar 1, 2018, 11:29 PM EST
Dhimesh Parmar132 reputationPosted Mar 2, 2018, 9:22 PM EST