本文介绍了当我尝试连接我的C sharp项目以访问2010时,它会给出错误“找不到可安装的ISAM”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
When i try to connect my c sharp project to access 2010 it give error "Could not find installable ISAM" and i am using visual studio 2010. but when i use visual studio wizard for connection to database it works
这是App.config文件的代码。
Here is the code of App.config file.
<pre><configuration>
<appSettings>
<add key="connection" value="Provider=Microsoft.ACE.OLEDB.12.0; DataSource=C:\\Users\\Varun\\Documents\\InventoryManagement.accdb" />
</appSettings>
</configuration>
Form1.cs文件的代码
code of Form1.cs file
using (OleDbConnection con = new OleDbConnection(ConfigurationManager.AppSettings["connection"]))
{
con.Open();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM Logg",con);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtUserName.Text = dr["User_name"].ToString();
}
}
我尝试了什么:
我尝试将平台目标更改为x86,x64,任何平台都无效。
What I have tried:
I tried changing platform target to x86, x64, any platform nothing works.
推荐答案
这篇关于当我尝试连接我的C sharp项目以访问2010时,它会给出错误“找不到可安装的ISAM”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!