Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid object name 1

Status
Not open for further replies.

tjherman

Programmer
Jun 19, 2006
68
US
I'm using Visual Studio 2005 (vb code) and have a stored procedure (named sp_Pricing) that supplies the data for a Crystal Report.

When I try to run the report, I get this message:

"Invalid object name (sp_Pricing)"

Here's the code I have so far:

Dim Connection As String = ConfigurationManager.ConnectionStrings("SmartConnectionString").ConnectionString
Dim strSQL As String = "Select * From sp_Pricing"
Dim DA As New SqlDataAdapter(strSQL, Connection)
Dim DS As New DataSet
DA.Fill(DS)

'Get the Report Location
Dim strReportPath As String = Server.MapPath("TJH.rpt")

'Check file exists
If Not IO.File.Exists(strReportPath) Then
Throw (New Exception("Unable to locate report file:" & vbCrLf & strReportPath))
End If

'Assign the datasource and set the properties for Report viewer
Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument

rptDocument.Load(strReportPath)
rptDocument.SetDataSource(DS.Tables(0))
CrystalReportViewer1.ReportSource = rptDocument

******
The error code displays on the "DA.Fill(DS)" line.

Can anyone help me with this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top