title: SQL Select ID from automatically generated rows with C#
body: <p>Basically whenever i would press a button on my website it would generate some kind of report with the ID and other information. What am trying to do is change one column of the table with SQL statements. I managed to change it but the code changes the column for all the IDs. What am trying to do is change column according to ID, but am still new to C# and SQL so i'm not sure how to get the automatic generated row. Just to highlight that i'm using a button in a gridview to change the value in the column. Below is what i tried: </p>
  
  <pre><code>protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
      {
  
          string order = Request.QueryString["id"];
  
          SqlConnection con = new SqlConnection();
          con.ConnectionString = ConfigurationManager.ConnectionStrings["RCManiaConnectionString"].ConnectionString;
          con.Open();
  
          if (e.CommandName == "received")
          {
              SqlCommand com = new SqlCommand();
              com.Connection = con;
              com.CommandText = "UPDATE [Orders] SET Status = 'Received' WHERE [ID] ='" + order + "'";
              SqlDataReader data = com.ExecuteReader();
  
          }
      }
  </code></pre>