10
我想要一个DataGridView 2000数据库上的Visual Studio连接到接入Access数据库2008“关键字不支持:提供”连接到VS08
我不断收到“不支持关键字:提供”错误,因为我对.Net上的Windows开发相当陌生,我不知道我是否正确地做。
下面的代码:提前
Try
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Contingencia\Carga_sap.mdb;User Id=admin;Password=;"
Dim strQuery As String = "SELECT ..."
Dim dataAdapter = New SqlDataAdapter(strQuery, strConn)
Dim table As New DataTable()
table.Locale = System.Globalization.CultureInfo.InvariantCulture
dataAdapter.Fill(table)
bsLista.DataSource = table
GridListado.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
感谢
编辑:我只需要数据适配器更改为OLE:
Dim dataAdapter = New OleDbDataAdapter(strQuery, strConn)
Doh!你是绝对正确的,可悲的是系统说我需要15个代表投票你的帖子作为helpfull :( – 2011-04-05 19:38:58