title: Gridview: Sql Update statement "Where RowID=Current editing row number" , how to set it in update statment?
body: <p>I have a simple gridview and sqldatasource to bind data from datatable to gridview.</p>
  
  <ul>
  <li>// "Column" is a column , type : int , increment by one , primary key</li>
  </ul>
  
  <p>// ID is just a column type int 
  Here is my code in row updating event:</p>
  
  <pre><code> string con = "conn string";
  
              string sqlQuery = "Update TableName set Column = @Column WHERE RowID = '1' (//here I need to get the current editing row number)";
              using (SqlConnection dataConnection = new SqlConnection(con))
              {
                  using (SqlCommand dataCommand = new SqlCommand(sqlQuery, dataConnection))
                  {
                      int vas = 121;
                      dataCommand.Parameters.AddWithValue("Column", vas);
                      dataConnection.Open();
                      dataCommand.ExecuteNonQuery();
                      dataConnection.Close();
  
                  }
  
              }
  </code></pre>
  
  <p>Here are my questions:</p>
  
  <p>1.For this code :     string sqlQuery = "UPDATE mytable SET ID = '131' WHERE No = '1' ";</p>
  
  <ul>
  <li>I dont want to set the No fixed , I want to set like this
  No=CurrentEditingRowNumber but I don't know how can I do that and
  make it work.</li>
  <li>I know how to get the current editing ( think so ) :  GridViewRow row
  = GridView1.Rows[e.RowIndex];</li>
  <li>But I don't know how to use it in the update statment</li>
  </ul>
  
  <p>2.For the code above if I open it in browser and let's say there are 2 rows ( 1 and 2 ) and my code says to update if No = 1 .</p>
  
  <p>If press Update to the first row nothing happens but if I press update from the second row then the code is executing on the first row as it was coded.. how can I fix that ?</p>
  
  <p>Thanks</p>