Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted
Updated 23-Aug-20 6:39am

Add the <startup> code below code under the <configuration> element in your app.config

<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
 
Share this answer
 
I once encountered this error on my Windows 7 machine and it was resolved after I installed .Net Framework 4.5 on the machine.
 
Share this answer
 
Comments
CHill60 24-Aug-20 5:12am    
Somehow I don't think that would have worked back in July 2014

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900