473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make common connection string for diff program?

Hi
i have a problem where as i want to use two different C# net program
in a single system where i have used 2 different sql server name. when
i execute those program each time iam renaming the sql server name and
executing the programs. Is there any way where i can write a
connection string without using a sql server name or is there any
other possibility to solve this problem.
[Note : i don't want to use the same sql serve name for both the
programs.]
Mar 11 '08 #1
1 2058
Hi Manish,

I fail to see your problem. You say you have two different C# applications,
and two different SQL server instances? Why do you need to rewrite anything
to run the programs? Or do you have a single SQL server instance and rename
this instance for each of the applications, with one application using one
instance name and the other application using another?! If the latter is
true why can't you use the same sql server name as the other program?

The connection strings should for each of the programs be put in a Setting
and available in the app/web.config file for the applications. You could
then either just rewrite the connectionstrin g for either of the applications,
or encrypt the connection string and maybe have the sql server instance name
in a separate setting and dynamically create the connectionstrin g at runtime.

If this doesn't answer your question, please clarify your problem with added
information.

--
Happy Coding!
Morten Wennevik [C# MVP]
"Manish" wrote:
Hi
i have a problem where as i want to use two different C# net program
in a single system where i have used 2 different sql server name. when
i execute those program each time iam renaming the sql server name and
executing the programs. Is there any way where i can write a
connection string without using a sql server name or is there any
other possibility to solve this problem.
[Note : i don't want to use the same sql serve name for both the
programs.]
Mar 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
281
by: Steve | last post by:
I have installed an application out to about 15 machines. Some NT (service pack 6) and some Windows XP. They all work......except for one machine. It is an NT machine. I cant work out why it wont work on this machine. The error occurs when logging in. It complains that ExecuteReader is failing as the Connection is closed. My connection...
2
2525
by: Alex Smith | last post by:
Hi Friends I want to make common connection string for database. I can not use Web config file, so please give idea excluding web.config file. Thanks. Alex
6
1498
by: Mike L. | last post by:
Hi, Pls, beware that I'm new to this :) I've developed several web appl, either with ASP or ASP.NET. All using SQL server as the back end. In my development environment, I have a single server running Win2K, which serves as Web Server and SQL server as well. And, since my hosting (production server) using the same config; ie: using a...
35
5802
by: jacob navia | last post by:
Hi guys! I like C because is fun. So, I wrote this function for the lcc-win32 standard library: strrepl. I thought that with so many "C heads" around, maybe we could improve it in a collective brainstorming session. Let's discuss some C here, for a change :-)
6
4854
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still...
19
2420
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; //every class may have this statement self.hello = function() {
12
1871
by: =?Utf-8?B?S2plbGw=?= | last post by:
Hello I've taken a four days training in C#, very good training, experienced teacher and all that, very positive. Went home spent a week making my first application, slightly more than the usual "Hello world". Took it with me to my best customer, and beleive it or not....It will not work !!!!
15
2895
by: Michael B Allen | last post by:
I like to use limit pointers as sentinels when working on buffers of data. Meaning I use ptr < lim where ptr and lim are both pointers rather than n 0 to determine if it is safe to proceed writing to that location. The rationale is that it is simpler and thus safer because you're not constantly recomputing integer n. However, I've run into...
2
1067
by: Manish | last post by:
Hi i have a problem where as i want to use two different C# net program in a single system where i have used 2 different sql server name. when i execute those program each time iam renaming the sql server name and executing the programs. Is there any way where i can write a connection string without using a sql server name or is there any...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
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.