title: How to update multiple rows / How to perform Operation on multiple records (C#, SQL Server)
body: <p>I have a database table name <code>Players</code> (ID, Name, Scores).
  here is my code to binding it with database</p>
  
  <pre><code>    private  void playerList(int team1_ID)
      {
          try
          {
              if (con.State == ConnectionState.Closed)
              {
                  con.Open();
              }
              string query = "SELECT player_name AS [Player Name] , Score AS [Score] FROM Players WHERE Team_id= " + team1_ID;
  
              SqlCommand cmd = new SqlCommand(query, con);
              adapter = new SqlDataAdapter(cmd);
              adapter.Fill(ds, "Players");
              dGridPlayers.DataSource = ds.Tables["Players"];
          }
          catch (SqlException ex)
          {
              MessageBox.Show(ex.Message);
          }
          finally
          {
              con.Close();
          }
      }
  </code></pre>
  
  <p>This code is working fine. It returns a list of 11 players and their Scores.  </p>
  
  <p>Now I want to perform some arithmetic operation on <code>Score</code> of each player and want to store back (update ) to the database table. Please tell how to do this.</p>
  
  <p>(<em>I don't want to hit SQL every time to <code>update</code> for each player's score. I want to update every players scores in one go after finishing the operations.</em>)</p>