title: Why I need the SqlCommandBuilder to update a table in Database?
body: <p>I watched a video tutorial and reprogrammed the same code. I have noticed that a didn´t understand, why I have to use the SqlCommandBuilder for updating a table.</p>
  
  <pre><code>    SqlDataAdapter sda;
      SqlCommandBuilder scb;
      DataTable dt;
  
      private void button2_Click(object sender, EventArgs e)
      {
          scb = new SqlCommandBuilder(sda);
  
          sda.Update(dt);
      }
  </code></pre>
  
  <p>I never use the variable <em>scb</em>. But when I comment out the <code>scb = new SqlCommandBuilder(sda)</code>, then I get an error message: </p>
  
  <blockquote>
    <p>"System.InvalidOperationException: A valid update command is required for an update."</p>
  </blockquote>
  
  <p>Can someone explain, what function the CommandBuilder has? </p>
  
  <p>In the remarks of the <a href="https://msdn.microsoft.com/en-us/library/w0154tsb(v=vs.110).aspx" rel="nofollow noreferrer">documentation</a> it says: </p>
  
  <blockquote>
    <p>The SqlCommandBuilder registers itself as a listener for RowUpdating events that are generated by the SqlDataAdapter specified in this property.</p>
  </blockquote>
  
  <p>But I don´t understand when the CommandBuilder steps into action? </p>