Imports System.Data
Imports System.Data.OleDb
Public Class dtcostom
Private Sub dtcostom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conStr As String = "Provider=Microsoft.Ace.Oledb.12.0;Data Source=C:\Car\db\car.accdb;"
Dim conn As New OleDbConnection(conStr)
conn.Open()
Dim sql As String = "SELECT * FORM costommer"
Dim cmd As New OleDbCommand(sql, conn)
Dim adapter As New OleDbDataAdapter(cmd)
Dim data As New DataSet()
adapter.Fill(data, "X")
DataGridView1.DataSource = data.Tables("X")
End Sub
End Class