473,511 Members | 10,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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.

Thanks

Adeel Shahid
Oct 30 '07 #1
5 2415
Plater
7,872 Recognized Expert Expert
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
adeel shahid
4 New Member
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

Thanks

Adeel Shahid
Oct 30 '07 #3
Plater
7,872 Recognized Expert Expert
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
adeel shahid
4 New Member
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.


thanks

Adeel Shahid
Oct 30 '07 #5
Plater
7,872 Recognized Expert Expert
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

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

Similar topics

6
7257
by: Paul Robinson | last post by:
I am developing a website in ASP that connects to a Sybase database. However, when I try to open a connection to the database the page will not load. The script does not timeout, nor the...
3
3897
by: G-Fit | last post by:
Hello group, I have several servers hosting SQL databases. On each of them, I have several databases. All those databases have the same structure (even those on different servers), only the data...
2
1305
by: John | last post by:
Hi there, I have been having a nightmare with one of ASP .Net 2.0 app which works fine in our development environment. WHen I move to the production server the database is getting wacked. I am...
2
7700
by: fatboy | last post by:
I'm trying to change the database and server on a report that was created using integrated security e.g. report was created pointing to the server 'testserver' and database 'testdb' and at runtime...
7
2174
by: Bernie Yaeger | last post by:
I can't believe that there aren't lots of developers who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it and then,...
14
3480
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
11
2261
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Is there a way in ASP.NET 2.0 to have different connection strings settings in a web.config files that are dynamically used based upon the server that the web application is running on? For...
11
2474
by: =?Utf-8?B?UGF1bA==?= | last post by:
I did a google search but could find what I was looking for. I am creating a temporary folder and placing files in it with a web application. The temporary folder name needs to be changed...
2
2175
by: hmznzr | last post by:
i am using b.net 2005. i am generating a crystal report. but when i work in a different computer i have to set the location of the database of the report before i generate. is their any dynamic way...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.