i got it. this is the code....
protected void UpdateRecord(object sender, GridViewUpdateEventArgs e)
{
string id = gridRegistrationTableDetails.Rows[e.RowIndex].Cells[2].Text;
string name = ((TextBox)gridRegistrationTableDetails.Rows[e.RowIndex].Cells[3].Controls[0]).Text;
string address = ((TextBox)gridRegistrationTableDetails.Rows[e.RowIndex].Cells[4].Controls[0]).Text;
string dept = ((TextBox)gridRegistrationTableDetails.Rows[e.RowIndex].Cells[5].Controls[0]).Text;
string mail = ((TextBox)gridRegistrationTableDetails.Rows[e.RowIndex].Cells[6].Controls[0]).Text;
updaterecordMethod(name, address, dept, mail);
gridRegistrationTableDetails.EditIndex = -1;
BindData();
}
private void updaterecordMethod(string name,string address,string dept,string mail)
{
string UpdateQuery = "update ISSSignUP set Employee_Name=@Empname,Employee_Address=@EmpAddress,Employee_Email=@EmpMail,Employee_Department=@EmpDept";
try
{
SqlConObject.Open();
SqlCommand cmd = new SqlCommand(UpdateQuery, SqlConObject);
cmd.Parameters.AddWithValue("@Empname", name);
cmd.Parameters.AddWithValue("@EmpAddress", address);
cmd.Parameters.AddWithValue("@EmpMail", mail);
cmd.Parameters.AddWithValue("@EmpDept", dept);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
finally
{
SqlConObject.Close();
}
}