Dear All
What is a mistake I am getting error in below codes conn is not opening
Imports System.Data.OleDb Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim DBConn As New OleDbConnection Dim DBcomm As New OleDbCommand 'Dim DBReader As OleDbDataReader Dim sqlStr As String DBConn = New OleDbConnection("provider = Microsoft.ACE.OLEDB.15.0;DataSource = MyDB.accdb") DBConn.open() sqlStr = "Insert into Mytablename (Name, Entry time, Exit time, Date) Values( '" + Nametextbox.Text + "', '" + Entrytimetextbox.Text + "', '" + Exittimetextbox.Text + "', '" + datetextbox.Text + "')" DBcomm.ExecuteNonQuery DBComm = New OleDbCommand(sqlStr, dbconn) DbConn.Close() End Sub
pl let me know correct things
Sunil