foreach (GridViewRow gvr in GridView1.Rows)
{
CheckBox cbb = (CheckBox)gvr.Cells[6].Controls[1];
if (cbb.Checked)
{
TextBox txt = (TextBox)gvr.Cells[6].Controls[2];
string str = ((System.Web.UI.DataBoundLiteralControl)(gvr.Cells[0].Controls[0])).Text;
SqlConnection con = new SqlConnection("Data Source=GAURAV-PC\\SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True");
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "execute this @Eid,@txtvalue";
cmd.Parameters.Add("@Eid", SqlDbType.Int).Value = str;
cmd.Parameters.Add("@txtvalue", SqlDbType.VarChar).Value = txt.Text;
}
}