title: VB 2008 - SQL Server 2005 - DataGridView - update button - write changes to database
body: <p>I'm new to vb.</p>
  
  <p>Currently, I'm populating 'DataGridView1' with data from a table in a SQL Server 2005 database.
  I need to be able to write back all changes made by simply clicking <code>btnupdate</code></p>
  
  <p>Related threads on this site handle specific cases and not all code is accepted by VS in my case so they're not really helpful.</p>
  
  <p>So:</p>
  
  <pre><code>Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click
      'This needs to save the changes to the database'
  End Sub
  </code></pre>
  
  <p>Is there a simple piece of code that I can insert?</p>
  
  <p>thanks.</p>