title: Add a New Record to Microsoft Access Database using VB.Net?
body: <p>I have a form called (Registration), and a database called (UsersLogin) with a table called (tbl_user) with the fields </p>
  
  <ul>
  <li>(first_name)</li>
  <li>(last_name)</li>
  <li>(middle_name)</li>
  <li>(age)</li>
  <li>(address)</li>
  <li>(username)</li>
  <li>(password). </li>
  </ul>
  
  <p>I want to not only be able to edit records (I can already do this), but I cant seem to be able to add/create a new row/record. Below is the class <code>registration</code> I am using so far to <strong>update</strong> a database row, but I can't seem to be able to 'add' a new record (rather than simply updating):</p>
  
  <pre><code>Imports System.Data
  Imports System.Data.SqlClient
  Public Class Registration
      Private Sub Registration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          Try
              Me.Tbl_userTableAdapter.Fill(Me.UsersLoginDataSet.tbl_user)
          Catch ex As Exception
              MessageBox.Show("The database file is unavailable", "Database Unavailable", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
              Me.Close()
          End Try
      End Sub
  
      Private Sub btnSaveChanges_Click(sender As Object, e As EventArgs) Handles btnSaveChanges.Click
          Try
              Me.Validate()
              Me.TbluserBindingSource.EndEdit()
              Me.Tbl_userTableAdapter.Update(Me.UsersLoginDataSet)
              MessageBox.Show("Updates to the database have been successful.", "Successful Updates", MessageBoxButtons.OK, MessageBoxIcon.Information)
          Catch ex As Exception
              MessageBox.Show("Updates to the database have failed.", "Unsuccessful Updates", MessageBoxButtons.OK, MessageBoxIcon.Error)
          End Try
      End Sub
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          LoginScreen.Show()
          Me.Hide()
      End Sub
  End Class
  </code></pre>
  
  <p>The dataset is called <code>UsersLoginDataSet.xsd</code></p>
  
  <p>Anyone know how to add a new user (i.e. make a new row), and hence write this to a table?</p>
  
  <p>I have looked for several solutions to this on the web, but have not been able to add a new row and hence "fill" the record in the database.</p>
  
  <p>Could anyone possibly explain how this <em>should</em> be done? </p>