Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 2556

System.IO.FileNotFoundException was unhandled

$
0
0

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?

Viewing all articles
Browse latest Browse all 2556

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>