Dim str As String
Dim com As OleDb.OleDbCommand
Dim rs As OleDb.OleDbDataAdapter
Dim myconnection As New OleDb.OleDbConnection
Dim DT As New DataTable
str = "SELECT * FROM Stock1คงเหลือ"
myconnection.Open()
com = New OleDb.OleDbCommand(str, myconnection)
rs = New OleDb.OleDbDataAdapter(com)
rs.Fill(DT)
myconnection.Close()
DataGridView1.DataSource = DT
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\Users\admim\Desktop\Database.accdb"
con.Open()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("SELECT * FROM tb_type", con)
da.Fill(dt)
DataGridView1.DataSource = dt.DefaultView
con.Close()