title: How to INSERT into table using Entity Data Model (EDMX)
body: <p>I am trying to write a button handler in VB.NET that will read rows from a gridview and write them to a DB if a checkbox is checked.</p>
  
  <p>I setup this application to use EntityDataSource and added my .edmx file to a DAL folder.  I have the button method written but I do not know enough about EF to know how to handle the data the data from the gridview. Here is my btn_click method:</p>
  
  <pre><code>Private Sub btnGetChecks_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGetChecks.Click
  '********************************************
  '* gets status of checkbox and writes to db *
  '********************************************
  Dim row As GridViewRow
  
  Label6.Text = ""
  For Each row In DvsGridView.Rows
    Dim RowCheckBox As CheckBox = CType(row.FindControl("chkStatus"), CheckBox)
    If RowCheckBox.Checked Then
      Label6.Text += row.Cells(5).Text &amp; " Checked "
      ' Need to write checked data to the db
      ' ******* WHAT GOES HERE? *******
      Else
  
      Label6.Text += row.Cells(5).Text &amp; " Unchecked "
  
    End If
  Next
  End Sub
  </code></pre>
  
  <p>I am fairly new to EDMX but understand VB.net. Any direction would be greatly appreciated.</p>