cancel
Showing results for 
Search instead for 
Did you mean: 

System DSN

0 Kudos

So I have created all my reports using a system DSN in the control panel of windows. I would like to run these same reports out of the crystal reports viewer inside a c# winforms application. I do not want to have to setup the hard coded ODBC connection. The select statement and adapter binding is already in the crystal report. Is there a way to just point the report to c# created data source without performing all the table iterations and the select statements and data set adapter filling etc? I just want the same connection I have through the DSN just through code. Is this possible?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

CR and runtime will never save the Password so it must be set in code or using Windows AD on the DB Server then you can set the reports up using that connection option and it won't require connection info, as log as it's the same, CR keeps the Table info in the RPT file so it must match the DB.

If not using AD you must pass the connection info unless you want the user to enter the log on info every time.

If you are using Stored Procedures then it won't work because you need to enter the parameters values for the SP in code.

Try this test app:

how-to-parameters-in-crystal-reports-for-visual-studio-net

It's on the download WIKI:

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

You could use a File DSN to save the password but not very secure.

Don

Answers (4)

Answers (4)

0 Kudos

Everything I try just using a connection string doesn't connect and run the report. It doesn't think there is a connection.

0 Kudos

Don thanks for the reply. So the issue is I am using a system DSN to setup my database on each and every pc that I deploy my software on. I simply want to do away with that hardcoded system DSN. I would like to connect to the crystal report using a connection string. I am not changing my database name or any table names. What is a way I can make this connection through code?

0 Kudos

I am using a proprietary database driver. Like I had mentioned it works perfectly as long as I setup the hard coded connection. I just want to make that connection through code.

DellSC
Active Contributor
0 Kudos

What type of database are you connecting to?

-Dell