title: Inserting and Updating values in MS Access Using vb.net
body: <p>I have checked most of the forums on this site but I didn't get my Solution.
  My problem is Inserting data from vb.net to MS Access but I am not able to do.
  Its not showing any error but also its not inserting values in my table. 
  I am using very simple code:</p>
  
  <pre><code>Imports System.Data.OleDb
  
  Public Class Add_LEads
  
      Dim conn As New OleDbConnection
      Dim cmd As New OleDbCommand
      Dim da As New OleDbDataAdapter
      Private Sub Add_LEads_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          conn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\IndGlobalDB.accdb;Persist Security Info=True;Jet OLEDB:Database Password=admin")
          lblDate.Text = Format(Date.Now, "yyyy/MM/dd")
          conn.Open()
          Dim sql As String
          Dim a As Integer
          sql = "select S_No from Leadss"
          cmd = New OleDbCommand(sql, conn)
          Dim dr As OleDbDataReader
          dr = cmd.ExecuteReader
          While dr.Read
              a = dr(0)
          End While
          lblNo.Text = a + 1
          conn.Close()
      End Sub
      Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
          conn.Open()
          cmd.Connection = conn
          cmd.CommandText = "INSERT INTO Leadss(S_No,Contact_Person,Mobile_No,Email_Id,Description,First_Follow_Up,Remarks,L_Date,Alternate_no)VALUES('" &amp; lblNo.Text &amp; "','" &amp; txtName.Text &amp; "','" &amp; txtMobile.Text &amp; "','" &amp; txtEmail.Text &amp; "','" &amp; txtWebDescr.Text &amp; "','" &amp; txtFollowUp.Text &amp; "','" &amp; txtRemarks.Text &amp; "','" &amp; lblDate.Text &amp; "','" &amp; txtAlternate.Text &amp; "')"
          cmd.ExecuteNonQuery()
          conn.Close()
          MsgBox("Saved!!!", vbOK)
      End Sub
      Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
          Me.Close()
          Welcome.Show()
      End Sub
  
  End Class
  </code></pre>