使用MS Access和C#时数据库连接和显示问题 [英] database connection and display issue while using ms access and c#

查看:106
本文介绍了使用MS Access和C#时数据库连接和显示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



建立连接后,我在gridview控件中显示数据时遇到问题.
有人可以帮我解决这个特殊问题吗?
并请帮助将ms Access 2007与C#连接并在gridview控件中将其替换.

谢谢与问候
阿布舍克
[DELETED] @ gmail.com

[edit]除非您真的喜欢垃圾邮件,否则请不要在任何论坛中发布您的电子邮件地址!如果有人回复您,您将收到一封电子邮件通知您.
不需要完整的代码:我们不会为您做作业(已删除请求). -OriginalGriff [/edit]

Hi,

I am facing a problem in displaying the data in gridview control while connection has been made.
Can anybody help me out for this particular problem.
And please help for connecting ms access 2007 with C# and for displaing it in gridview control.

Thanks&Regards
Abhishek
[DELETED]@gmail.com

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
Don''t ask for the complete code: we do not do your homework for you (deleted request). - OriginalGriff[/edit]

推荐答案

您保存的ms Access数据库是 Access 2002-2003数据库.
现在您尝试一下.
You save the ms access database is Access 2002 - 2003 Database.
Now you try this.


我会说网络上有很多例子正等待被谷歌搜索.这是一个很好的演练: http://www.switchonthecode .com/tutorials/csharp-tutorial-binding-a-datagridview-to-a-数据库 [
I would say that there are tons of example in the net just waiting to be googled. Here''s one quite goog walkthrough: http://www.switchonthecode.com/tutorials/csharp-tutorial-binding-a-datagridview-to-a-database[^]


using System.Data.OleDb;
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+"E:\Temp\Database1.accdb"); 
con.Open();


这篇关于使用MS Access和C#时数据库连接和显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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