Skip to Content
0

Crystal Reports for .NET SDK Sample csharp_win_dbviewer specifying wrong database

Nov 29, 2017 at 05:30 PM

39

avatar image
Former Member

I am having trouble with one of your examples: csharp_win_dbviewer. I am using Crystal Reports Viewer for Visual Studio 2016, Visual Studio Enterprise 2015, and SQL Server Management Studio v17.2. I loaded the "pubs" database that is called for in the example, in my local SQL Server instance. I opened the example solution in VS 2015, and it did a one-way VS upgrade (this example is from 2002, I believe). The only change I made was to the physical server name literal, from "rcon1" to my local machine name.

When I ran the solution the first time, I was getting the SQL Server Error: 18456, Severity: 14, State: 38. "Login failed for user 'XYZ123\ABC456$'. Reason: Failed to open the explicitly specified database 'ReportServer'. [CLIENT: <local machine>]". Then I reloaded both the pubs database and the example solution. This second time I got the Error: 18456, Severity: 14, State: 5. "Login failed for user 'vantech'. Reason: Could not find a login matching the name provided. [CLIENT: <named pipe>]". When I change the UserID and Password literals to my own, I get the same error. This second error can happen when SQL Server does not find the database that is specified.

It seems to me that "ReportServer" is the database that the app is trying to login to after it is explicitly set to "pubs" in the code. Can you tell me how to fix this example? Thank you.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Don Williams
Nov 30, 2017 at 02:12 PM
0

Use one of your own reports and change the server name, database, user and PW when logging on.

This one is a lot more complicated and you need to set parameters or comment out the code that calls the function but see it it works for you:

https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

The latest downloads and links to reference material is on this WIKI page:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Don

Share
10 |10000 characters needed characters left characters exceeded