用户未处理ArgumentException [英] ArgumentException unhandled by user

查看:78
本文介绍了用户未处理ArgumentException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想将数据从MSaccess 2007显示到gridview控件中.
我的代码给出了未处理的异常不支持的关键字:提供者"" .
我的源代码如下.

Hi,

I want to display data from MSaccess 2007 into gridview control.
My code is giving Unhandled exception "Keyword not supported: ''provider''".
My source code is given below.

string connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Documents and Settings\\Administrator\\My Documents\\my.accdb";
 string query= "Select * from fee where status=Pending ";
 SqlDataSource sds = new SqlDataSource(connection,query);
GridView1.DataSource = sds;
           GridView1.DataSourceID = String.Empty;
           GridView1.DataBind();


请帮我一样.

致谢
Abhishek


Please help me out for the same.

Thank&Regards
Abhishek

推荐答案

很明显,形成的连接字符串存在问题.

我建议您在连接字符串 [ ^ ]!

上面的链接提供了有关连接字符串的所有信息.可以在这里阅读有关数据通信的更多信息:使用ADO.NET访问数据 [ ^ ]

在这里,您正在使用SQL,无需提供提供程序.只需删除提供程序,一切都会好起来.
Well, it''s quite clear that the connection string formed has issues.

I would suggest you to have a loot here at Connection String[^]!

The link above provides all info about connection string. Further info regarding the data communication can be read here: Accessing data with ADO.NET[^]

Out here, you are working with SQL, you don''t need to give the provider. Just remove the Provider and things should be fine.


这篇关于用户未处理ArgumentException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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