I'm in visual basic, trying to make a connection to a DB in access. To contextualize, the system is working with SQL, generating the connection data string, then the connection objects and their querys. The issue is that when trying to do the same, with access I get the header error, and that is when I send the data to the DataTable, they were using a .fill (). This is where he shows me the error. Error: "Fill is not a member of OleDbCommand"
The current code is as follows:
Connection String.
Public connection As String = "data source = MARLI_SRV; initial catalog = BD_Evasiones; user id = sa; password = xxxxxxxxxx"
Public access_connection As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=\C-186-PC\prueba\Evasiones 2017.accdb;"
Connection objects.
'Public Conexion As New SqlConnection(connection)
Public Conexion As New OleDbConnection(access_connection)
Select the database.
'Dim dr As New SqlDataAdapter("Select * From Evasiones Order by NroExpedicion", Conexion)
Dim dr As New OleDbCommand("Select * From Evasiones", Conexion)
Go to DataTable
Dim dz As New DataTable
dr.Fill(dz)