cancel
Showing results for 
Search instead for 
Did you mean: 

System.IO.FileNotFoundException was unhandled

Former Member
0 Kudos

Hello,

I am using CRforVS_13_0_16 with VS 2012. I have written a simple Winform application that is to display a simple report (all it does is display the first and last name of people in the tblNames)

Attached is the error page I'm getting. I get the error in the IDE.For references, I have:

CrystalDecisions.CrystalReports.Engine

CrystalDecisions.ReportSource

CrystalDecisions.Shared

CrystalDecisions.Windows.Forms

The code:

    Dim rpt As New rptNames
    Dim da As New SqlCeDataAdapter
    Dim dsNames As New DataSet("tblNames")
    Dim con As New SqlCeConnection
    Dim cmd As New SqlCeCommand

    con.ConnectionString = "Data Source=|DataDirectory|\NamesNumbers.sdf"
    con.Open()
    cmd.Connection = con
    cmd.CommandText = "select FirstName,LastName from tblNames"
    da.SelectCommand = cmd
    da.Fill(dsNames, "tblNames") 
    rpt.SetDataSource(dsNames)  ' This line generates the error
    CrystalReportViewer1.ReportSource = rpt

  End Sub

Why am I getting this error?
View Entire Topic
0 Kudos

In your App.config file add this line:

<startup useLegacyV2RuntimeActivationPolicy="true">

If you tried searching first you would have found this info...

Don