1
2
3
4
5
6
7
8
9
10
11
12
| Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim str As String = "Provider=Microsoft.jet.oledb.4.0;Data Source=c:\\northwind.mdb"
Dim conn As New OleDb.OleDbConnection
conn.ConnectionString = str
' Open a connection
conn.Open()
'Call GetOleDbSchemaTable
Dim schemaTable As DataTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
' Attach data row to the grid and close the connection
DataGrid1.DataSource = schemaTable
conn.Close()
End Sub
|
沒有留言:
張貼留言