1 2 3 4 5 6 7 8 9
| If Conne.State <> ConnectionState.Open Then Conne.Open()
DataGridView1.DataSource = Nothing
Dim InfoTable As DataTable
InfoTable = Conne.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
Dim Cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * From [" & InfoTable.Rows(0)("TABLE_NAME").ToString() & "]", Conne)
Dim Adp As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(Cmd)
Dim DS As DataSet = New DataSet()
Adp.Fill(DS)
DataGridView1.DataSource = DS.Tables(0) |
Partager