MS Access与C#Windows项目的连接 [英] MS Access connection with C# windows project

查看:95
本文介绍了MS Access与C#Windows项目的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在C#Windows base中有一个项目,我无法连接到ms访问,请问有人可以帮我吗?下面的代码给出了

Hi All,
I have a project in C# windows base, I m not able to connect to the ms access can any one hale me please? below code is given

private OleDbConnection con = new OleDbConnection();

 con.ConnectionString = Microsoft.VisualBasic.VBCodeProvider

推荐答案

看看http://www.connectionstrings.com/access-2007 [ ^ ]

您会遇到哪种异常?
Take a look at http://www.connectionstrings.com/access-2007[^]

What kind of exception do you get?


如果您查看Visual Studio中的服务器资源管理器"窗格,然后单击数据库,则连接字符串将列在属性"窗格中. /> 复制此代码,并将其粘贴为上面代码中"Microsoft.VisualBasic.VBCodeProvider"的连接字符串.
If you look at the Server Explorer pane in visual studio, then click on your database, the connection string will be listed in the Properties pane.
Copy this, and paste it as the connection string in place of "Microsoft.VisualBasic.VBCodeProvider" in your code above.




看看ConnectionStrings的不同方式:

对于访问 [ ^ ]
对于 Access 2007 [
Hi,

Have a look at Different ways of ConnectionStrings:

For Access[^]
For Access 2007[^]

P.S: Please check connecting properly.


这篇关于MS Access与C#Windows项目的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆