The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Clab (3) [Avatar] Offline
Hello Mr. Lachev,
I do change connstring programmatically (before load report) in my reports RS2005.
There are my test case executed:

1) I tried using report specific connection:
<ConnectString>="Data Source=.IS2009;Initial Catalog=" & Parameters!Database.Value</ConnectString>

It works but I don't satisfied, because I can't pass pwd and userid into URL as parameters.

2) Exist a possibility to switch from "Shared DataSource 1" to "Shared Data Source 2" at execution time ?

3) Another case is using Custom Data Extension.
For write my CDE, I started from your DsConnectionWrapper class (include in CDE sample), but what I do write into CreateCommand method?
My reports using all Stored Procedure, and it's works perfectly; I can't change mode of retrieve data, I do change only connection string.

Many Thank's

Best regards
tlachev (687) [Avatar] Offline
Re: Change connection string RS2005
1) Altought not officially supported, you can store the user credentials in the Report Server web.config file. This download shows how this could be implemented.

2) No. Expressions must be scoped at report level, hence only private data sources can have expression-based connection strings.

3) This the most involved approach which I'd consider last. In this case, you replace the RS data provider with your own. So, the command text could be the stored procedure name but you have to write logic to execute the stored procedure and fetch the results. Besides, you will run into security issues. So, try 1) instead.
Clab (3) [Avatar] Offline
Re: Change connection string RS2005
Thank you, mr. Lachev.
abhi_9704 (1) [Avatar] Offline
Re: Change connection string RS2005
how to change and read all name in connection string section of webconfig file