在向大家詳細介紹VB
Visual Basic
VB
VB
VB
采用OleDbConnection對象
Private Function getAccessConnection() As OleDbConnection
Dim dbConnectionString As String =
Data Source=|DataDirectory|\Resources\mag
Dim dbConnection As OleDbConnection = New OleDbConnection(dbConnectionString)
Try
dbConnection
Catch Ex As Exception
End Try
Return dbConnection
End Function
private Sub fillDataGridView()
Dim sqlStr As String =
Dim DataAdapter As New OleDbDataAdapter
Dim dataSet As New DataSet
Dim DataGridView As New DataGridView
Dim dbConnection As OleDbConnection = getAccessConnection()
If dbConnection
MsgBox(Chr(
Exit Sub
End If
DataAdapter
Try
DataAdapter
DataGridView
Catch Ex As Exception
MsgBox(Err
Finally
dataSet
DataAdapter
dbConnection
dbConnection
End Try
End Sub
VB
From:http://tw.wingwit.com/Article/program/net/201311/12382.html