how to get value from table in RowEditing
<p>I have a grid view that has the columns <code>id</code>, <code>f_name</code>, <code>l_name</code> and <code>salary</code>. I want to get the value of it from grid view. </p>

<p>I have this code you can take a look to get what I mean:</p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)

            bindgrideview();
    }
    protected void bindgrideview()
    {
        SqlConnection strcon1 = new SqlConnection(strcon);
        strcon1.Open();
        string ADDStr = "SELECT ID,F_name , L_name , salary FROM Employee ";
        SqlCommand ADDCmd = new SqlCommand(ADDStr, strcon1);
        DataTable table = new DataTable();
        SqlDataAdapter adapter = new SqlDataAdapter(ADDCmd);
        adapter.Fill(table);

        GridView1.DataBind();

    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        int id= // what must be write here ? 
        GridView1.EditIndex = e.NewEditIndex;
        bindgrideview();
        SqlConnection strcon1 = new SqlConnection(strcon);
        strcon1.Open();
        string ADDStr = "SELECT ID FROM Employee ";
        SqlCommand ADDCmd = new SqlCommand(ADDStr, strcon1);
        Reademp(id);
    }
    public void Reademp(int ID)
    {
        SqlConnection strcon1 = new SqlConnection(strcon);
        strcon1.Open();
        string ADDStr = "SELECT ID,F_name , L_name , salary , [department ID]  ,  [saudi_nationality] , [position ID]  , [role ID] FROM Employee ";
        SqlCommand ADDCmd = new SqlCommand(ADDStr, strcon1);
        DataTable table = new DataTable();
        SqlDataAdapter adapter = new SqlDataAdapter(ADDCmd);
        adapter.Fill(table);
        GridView1.DataSource = table;
        GridView1.DataBind();
        SqlDataReader myDataReader;
        myDataReader = ADDCmd.ExecuteReader();
        myDataReader.Read();

        string F_name = myDataReader["F_name"].ToString();
        string L_name = myDataReader["L_name"].ToString();
        string department_ID = myDataReader["[department ID]"].ToString();
        string saudi_nationality = myDataReader["saudi_nationality"].ToString();
        string position_ID = myDataReader["[position ID]"].ToString();
        string role_ID = myDataReader["[role ID]"].ToString();
        myDataReader.Close();

    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        string F_name = TextBox1.Text;
        string L_name = TextBox2.Text;
        string salary = TextBox3.Text;
        int status = 1;

        SqlConnection strcon1 = new SqlConnection(strcon);
        strcon1.Open();
        string ADDStr = "ADDEMPLOYEE";
        SqlCommand ADDCmd = new SqlCommand(ADDStr, strcon1);
        ADDCmd.CommandType = CommandType.StoredProcedure;
        ADDCmd.Parameters.AddWithValue("@F_name", F_name);
        ADDCmd.Parameters.AddWithValue("@L_name", L_name);
        ADDCmd.Parameters.AddWithValue("@salary", salary);
        ADDCmd.Parameters.AddWithValue("@status", status);

        ADDCmd.ExecuteNonQuery();
        bindgrideview();
        TextBox1.Text = "";
        TextBox2.Text = "";
        TextBox3.Text = "";
    }
</code></pre>
