Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

How to make common connection string for diff program?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manish - 11 Mar 2008 19:42 GMT
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.]
Morten Wennevik [C# MVP] - 12 Mar 2008 07:17 GMT
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 connectionstring 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 connectionstring at runtime.

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

Signature

Happy Coding!
Morten Wennevik [C# MVP]

> Hi
> i have a problem where as i want to use two different C# net program
[quoted text clipped - 5 lines]
> [Note : i don't want to use the same sql serve name for both the
> programs.]

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.