问题描述
我目前正在使用visual studio 2010和MS access DB。我安装了水晶报告2008.我使用Windows窗体和水晶报告查看器控件。在按钮上单击我想在水晶报表查看器中显示数据库中的报表。但我遇到以下错误消息。
---------------------------
Crystal Reports Viewer
---------------------------
无法加载数据库信息。
详细信息:无法加载数据库连接器crdb_p2bbnd.dll。可能未安装此数据库类型的数据库客户端的正确版本。
这里是代码
string connetionString = null;
OleDbConnection cnn;
DataTable OledbDt = new DataTable(数据库中的表名);
OleDbDataAdapter OleDbAdapter = new OleDbDataAdapter();
string sql = null;
connetionString =Provider = Microsoft.Jet.OLEDB.4.0; Data Source = XXXXX.mdb;;
sql =select * from table name from the database;
cnn = new OleDbConnection(connetionString);
尝试
{
cnn.Open();
OleDbAdapter = new OleDbDataAdapter(sql,cnn);
OleDbAdapter.Fill(OledbDt);
ReportDocument rptDoc = new ReportDocument();
我的rpt文件名abc = new我的rpt文件名();
abc.SetDataSource(OledbDt);
crystalReportViewer2.ReportSource = abc;
crystalReportViewer2.RefreshReport();
OleDbAdapter.Dispose();
cnn.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,Error);
}
}
i搜索了我的整个系统,但我没有找到要添加的dll。我搜索了错误消息,但得到了reuslts,没有这样的DLL。请尽快帮助我解决这个问题。非常感谢提前
Hi,
I am currently working with visual studio 2010 and MS access DB. i ahve installed crystal reports 2008. I use windows forms and a crystal reports viewer control in it. On a button click i want to show a report from database in a crystal reports viewer. But i encounter the following error message.
--------------------------- Crystal Reports Viewer --------------------------- Failed to load database information. Details: The database connector 'crdb_p2bbnd.dll' could not be loaded. The correct version of the database client for this database type might not be installed.
here is the code
string connetionString = null; OleDbConnection cnn; DataTable OledbDt = new DataTable("Table Name from the database"); OleDbDataAdapter OleDbAdapter = new OleDbDataAdapter(); string sql = null; connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=XXXXX.mdb;"; sql = "select * from Table name from the database"; cnn = new OleDbConnection(connetionString); try { cnn.Open(); OleDbAdapter = new OleDbDataAdapter(sql,cnn); OleDbAdapter.Fill(OledbDt); ReportDocument rptDoc = new ReportDocument(); my rpt file name abc = new my rpt file name(); abc.SetDataSource(OledbDt); crystalReportViewer2.ReportSource = abc; crystalReportViewer2.RefreshReport(); OleDbAdapter.Dispose(); cnn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message,"Error"); } }
i searched my entire system but i coudn't find the dll to be added here. i googled out the error message but got reuslts with there is no such dll. kindly help me out with this issue as soon as possible. Many Thanks in advance
这篇关于无法在Crystal Reports查看器中加载数据库信息错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!