Hi!
I have and Microsoft Access database that I want to access with VB.NET.
What is the best way? I know how to use the Data Grid but I'm not sure what are the binding sources and Dataset...can I use them to do a query in the MS Access?
Right now I'm using something similar to:
Code:Dim conexao As New OleDb.OleDbConnection
Dim comando As New OleDb.OleDbCommand
Dim adaptador As New OleDb.OleDbDataAdapter
Dim dados As New DataTable
conexao = New OleDb.OleDbConnection
conexao.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\DB.accdb'"
Try
conexao.Open()
Try
comando.Connection = conexao
adaptador.SelectCommand = comando
Dim query = "SELECT Name, Diameter FROM Construction WHERE (Name LIKE 'PF')"
Dim dc = New OleDb.OleDbCommand(query, conexao)
Dim rows As OleDb.OleDbDataReader
rows = dc.ExecuteReader
???? how can I get the rows values? I'm not being able to to that...
Catch erro As Exception
MessageBox.Show("Error")
End Try
Catch erro As Exception
MessageBox.Show("Error")
Finally
conexao.Dispose()
End Try