I have a winforms program with sql backend. I needed to use Crystal Reports for some reports and so I installed the Visual Studio Crystal Reports. I could see the CrystalReportViewer in the toolbar and found online that you need to change the Target Framework from .NET Framework 4 Client Profile to .NET Framework 4. That solved that problem but now when I run the code to run the report - StateListButton.
I get this error. FileLoadException was unhandled.
I have searched the internet and found that you need to add the following code to the app.config but when I add anything I just get more errors.
This is what my app.config looks like right now.
Does anyone know how to fix this? I've been searching the internet for two days trying to find a fix for this. My whole program was originally built using the .NET Framework 4 Client Profile and now I needed to change it to .NET Framework 4 so I can use Crystal Reports.
Thanks!
Stacy
Code:
Private Sub StateListButton_Click(sender As System.Object, e As System.EventArgs) Handles StateListButton.Click
Dim zreport As New statelst
zreport.Load("c:\Member_Program\Reports\statelst.rpt")
Dim SearchValue As String = "MINNESOTA"
Dim ds As New StatelstReportDataSet
Dim ta As New StatelstReportDataSetTableAdapters.statelstTableAdapter
ta.FillByState(ds.statelst, SearchValue)
zreport.SetDataSource(ds)
CrystalReportViewer.CrystalReportViewer1.ReportSource = zreport
End Sub
Code:
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Code:
<startup selegacyv2runtimeactivationpolicy="true">
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
</startup>
Code:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Member_Program.My.MySettings.EAConnectionString" connectionString="Data Source=STACY-LAPTOP\SQLEX;Initial Catalog=EA;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>
</configuration>
Thanks!
Stacy