1.
protected
void
GridView1_SelectedIndexChanged(
object
sender, EventArgs e)
2.
{
3.
int
id = Int32.Parse(GridView1.SelectedRow.Cells[0].Text);
4.
sql =
"SELECT * FROM dbo.Products WHERE ProductID = '"
+id+
"'"
;
5.
con =
new
SqlConnection(WebConfigurationManager.ConnectionStrings[
"MyConnection"
].ConnectionString);
6.
cmd =
new
SqlCommand(sql, con);
7.
}