cancel
Showing results for 
Search instead for 
Did you mean: 

Database Connector Error using VS.NET 2008 Report Viewer

Former Member
0 Kudos

I have a Crystal report with 8 Parameters (5 String and 3 DateTime). 2 of these parameters are passed through to the Stored Proc Datasource. There are 3 subreports that are linked to the main report and have differing Parameters passed on to them and their Datasources.

When attempting to load up the report in a Report Viewer object in a custom VS.NET 2008 desktop application, I get the following error:

Crystal Report Windows Forms Viewer

-


Database Connector Error: ' [Database Vendor Code: 8114 ]'

Error in File <ReportName>

Database Connector Error

In my code I am looping through all of the CrystalReport.Database.Tables in order to set the DB/Server info via the ApplyLogOnInfo method.

This works fine in a VB 6.0 desktop application we are replacing, but the newer VS viewer seems to choke for some reason?

Any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Using Profiler it appears as though the Parameters are being sent to the Stored Procedure in the wrong order...

exec "DB"."dbo"."SPROC";1 {ts '2010-09-23 00:00:00'}, 'L'

When the parameters setup in the Sproc itself as DateTime then Char(1). So it should be sending:

exec "DB"."dbo"."SPROC";1 'L', {ts '2010-09-23 00:00:00'}

Or naming the parameters that it's passing values for (ie. @BDATE = {ts '2010-09-23 00:00:00'}, @RPTBY = 'L')

My question now is how can I get these to return in an order that matches? Changing the Stored Procedure itself seems like an easy fix, but not an acceptable solution as there are hundreds of other reports that will be converted/tested in a similar fashion.

Answers (3)

Answers (3)

Former Member
0 Kudos

For those of you wondering...

I found a work around for this issue. The report had the parameter list in one order, and the parameters I was passing were in a different order.

ie. Report was setup as @BDATE and then @REPORTBY, while I was passing the parameters using @REPORTBY first and then @BDATE.

I figured this would not be an issue, since I am setting the parameter values by name...for example...

@REPORTBY = Job

@BDATE = 09/01/2010

However, this provided the error mentioned in the OP.

When I switched the order of te parameter value assignments to...

@BDATE = 09/01/2010

@REPORTBY = Job

The error went away. So I guess don't assume you can pass parameter values in any order even if you are assigning them to the parameter by Name. Pass them in the same order as is listed in the RPT file itself to be safe.

0 Kudos

Hello,

Moved your post to the SDK forum. Search here, lots of examples on how to set database and parameter values.

There are also sample applications you can use to compare code with:

Root Page

http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsHome

Enterprise Samples (including managed and unmanaged ras)

http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications

Non-Enterprise Samples

http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications

Exporting Samples (RAS)

http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting

Thank you

Don

Former Member
0 Kudos

Stepping through the code as it's running the parameters are being set properly...

CrystalReport.SetParameterValue("@BDATE", "09/23/2010")

CrystalReport.SetParameterValue("@RPTBY", "L")

But somehow it's getting the order wrong or associating the param with the wrong value?