Hello
I'm working on a local mdb file.
I can send to Oledbdataadapter constructor 2 string variables.
I looked in MSDN and they say I still have to open connection with Oledbconnection to connect to my mdb file.
but I can work regulary without opening the connection.
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim constr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users.mdb;"
Dim ds As New DataSet()
Dim cmd As String = "SELECT * FROM Users"
Dim da As New OleDbDataAdapter(cmd, constr)
da.Fill(ds, "Users")
DataGridView1.DataSource = ds.Tables("Users")
Catch ex As Exception
MsgBox("File Not Found")
End Try
End Sub
End Class
in this way I can insert rows delete cells and everything
so why do I need the Oledbconnection?