Label lb = (Label)GridView1.Rows[e.RowIndex].FindControl("Label6");
TextBox tx1 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox1");
TextBox tx2 = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox2");
mycon.Open();
SqlCommand myupdatecommand = new SqlCommand("update Users set(user_name,user_surname) values('"+tx1.Text+"','"+tx2.Text+"') where user_id='"+lb.Text+"'", mycon);
myupdatecommand.ExecuteNonQuery();
GridView1.EditIndex = -1;
GridView1.DataBind();
谢谢!