从dataadapter填充数据集时出现错误 [英] I m getting error when filling dataset from dataadapter
本文介绍了从dataadapter填充数据集时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好......
从MS-Access数据库检索数据后,从dataadapter填充数据集时出现以下错误.
"IErrorInfo.GetDescription失败,并显示E_FAIL(0x80004005)"
以下是我用于填充数据集并绑定到gridview的代码.
Hello everybody....
I am getting the following error when i am filling dataset from dataadapter after retrieving data from the MS-Access database.
"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)"
following is the code i used to fill dataset and bind to gridview.
OleDbCommand cmd1 = new OleDbCommand("Select ID, PrjctName from Current", con);
OleDbDataAdapter da1 = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
Grid_Current.DataSource = ds1;
Grid_Current.DataBind();
推荐答案
Hello
http://www.codeguru.com/forum/archive/index.php/t- 419787.html [ ^ ]
检查此
Hello
http://www.codeguru.com/forum/archive/index.php/t-419787.html[^]
Check this out
由于MSAccess数据库而已出现.
使用以下查询
It is the occoured due to MSAccess database.
use following Query
Select [ID], PrjctName from Current
插入括号,然后再试一次.......
OleDbCommand cmd1 =新的OleDbCommand(从Current中选择[ID],[PrjctName]",同上);
OleDbDataAdapter da1 =新的OleDbDataAdapter(cmd1);
DataSet ds1 =新的DataSet();
da1.Fill(ds1);
Grid_Current.DataSource = ds1;
Grid_Current.DataBind();
通知是否出现错误?
Insert Bracket and try once more .......
OleDbCommand cmd1 = new OleDbCommand("Select [ID], [PrjctName] from Current", con);
OleDbDataAdapter da1 = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
Grid_Current.DataSource = ds1;
Grid_Current.DataBind();
inform whether error Comes or not?
这篇关于从dataadapter填充数据集时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文