checkBox in gridView problem
<p>i am using the following the code to populate table on clicking upon the checkbox but there is no change in table </p>

<p>protected void Button1_Click(object sender, EventArgs e)
    {
        con.Open();</p>

<pre><code>    for (int i = 0; i &lt; GridView1.Rows.Count; i++)
    {
        CheckBox chkUpdate = (CheckBox)
  GridView1.Rows[i].Cells[0].FindControl("chkSelect");
        if (chkUpdate != null)
        {
            if (chkUpdate.Checked)
            {
                string strID = GridView1.Rows[i].Cells[1].Text;
                SqlCommand cmd;
                string str1 = "update app1 set p_id=0 where p_id='" + strID + "'";
                cmd = new SqlCommand(str1, con);
                cmd .ExecuteNonQuery ();
            }
        }
    }
} 
</code></pre>
