Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal reports error in SetDataSource

I am having trouble in VS 2010 sap crystalreports, using c# to make a windows application.

I get the following error with the following code:

 CrystalReport1 cr1 = new CrystalReport1();
 cr1.SetDataSource(dt1); //Error 
Could not load file or assembly 'file:///C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.
like image 383
Rajesh Abraham Avatar asked Jun 07 '12 22:06

Rajesh Abraham


2 Answers

Try using this solution by adding the useLegacyV2RuntimeActivationPolicy attribute to your .config file

<startup useLegacyV2RuntimeActivationPolicy="true">
like image 164
Lee O. Avatar answered Nov 20 '22 10:11

Lee O.


 <startup useLegacyV2RuntimeActivationPolicy="true" >
    <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0" />
 </startup>

Add this code in app.config.

like image 37
Rajesh Abraham Avatar answered Nov 20 '22 10:11

Rajesh Abraham