title: How to add a row in ms access database in vb.net
body: <p>I am trying to add a data row on MS Access database using VB.Net code, but it seems not working, and it's not even giving me an error. Here is my code:</p>
  
  <pre><code>Private Sub btnComit_Click(sender As Object, e As EventArgs) Handles btnComit.Click
      If inc &lt;&gt; -1 Then
  
          Dim cb As New OleDb.OleDbCommandBuilder(da)
          Dim dsNewRow As DataRow
  
          dsNewRow = ds.Tables("Leaveform").NewRow()
  
          dsNewRow.Item("FullName") = txtFullName.Text
          dsNewRow.Item("Department") = txtDepartment.Text
  
          ds.Tables("Leaveform").Rows.Add(dsNewRow)
  
  
  
          da.Update(ds, "Leaveform")
  
          MessageBox.Show("New Record added to the Database")
  
          btnComit.Enabled = False
          btnAddNew.Enabled = True
          btnUpdate.Enabled = True
          btnDelete.Enabled = True
  
      End If
  </code></pre>