470,831 Members | 2,824 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,831 developers. It's quick & easy.

changing connection string from different servers to get report in c#

I m using .NET Crystal Report but i have to create report using different servers. right now the connection string is static using store procedure but i want to change the connection string at runtime using the storeprocedure.
Can any one help that how can i create a report using a different server address using storeprocedure and dataset.


Adeel Shahid
Oct 30 '07 #1
5 2222
7,872 Expert 4TB
Is the stored procedure on the other server?
Just create multiple connection strings, thatn you can use the one you want, when you want.
Oct 30 '07 #2
thanx for replying

the storeprocedure and database name on the other server is same but the server name is change.

the suggestion u gave i was unable to get it properly can u give any code example for that. i need it as early as possible

i will be grateful to you


Adeel Shahid
Oct 30 '07 #3
7,872 Expert 4TB
string constring1=<some connection string for server1>;
string constring2=<some connection string for server2>;

Then depending on which one you want, just use the correct connection string on your database connection object?
Oct 30 '07 #4
thanks for reply

but we need to change the string on runtime. as user connects from internal or external server the connection string should be according to the login.


Adeel Shahid
Oct 30 '07 #5
7,872 Expert 4TB
ok then do that.
Based on the login, decide which connection string to use.

If you are unsure how to create a string at runtime, I would REALLY suggest you go through a tutorial on the basics of programming.
Oct 30 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Paul Robinson | last post: by
3 posts views Thread by G-Fit | last post: by
2 posts views Thread by John | last post: by
11 posts views Thread by =?Utf-8?B?UGF0Qg==?= | last post: by
11 posts views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.