string cs = ConfigurationManager.ConnectionStrings["SS"].ToString(); SqlConnection con = new SqlConnection(cs); con.Open(); string txtusername = ((TextBox)gvdetails.Rows[e.RowIndex].Cells[3].Controls[0]).Text; string txtpassword = ((TextBox)gvdetails.Rows[e.RowIndex].Cells[4].Controls[0]).Text; string txtmobilenumber = ((TextBox)gvdetails.Rows[e.RowIndex].Cells[5].Controls[0]).Text; string txtemailid = ((TextBox)gvdetails.Rows[e.RowIndex].Cells[6].Controls[0]).Text; string userid = gvdetails.Rows[e.RowIndex].Cells[2].Text; SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "update userdetails set UserName='" + txtusername + "',Password='" + txtpassword + "',MobileNumber='" + txtmobilenumber + "',EmailId='" + txtemailid + "' where ...

Go to the complete details ...