|
-
Mar 14th, 2005, 06:12 AM
#1
Thread Starter
Member
How to change connection string dynamically across ALL pages in VS.NET?[Resolved]
Hi,
I have many ASP.NEt pages. I use the SQLConnection from the toolbox.
I move my project from one PC to another.
Now, i need a way to dynamically change the conenction string for the SQLConnection across all the pages in my project.
Who has methods to my problem?
Last edited by aspfan; Mar 14th, 2005 at 08:08 PM.
-
Mar 14th, 2005, 06:20 AM
#2
Re: How to change connection string dynamically across ALL pages in VS.NET?
-
Mar 14th, 2005, 08:46 AM
#3
Thread Starter
Member
Re: How to change connection string dynamically across ALL pages in VS.NET?
 Originally Posted by mendhak
Store it in web.config.
Is that the only step.
I think i also need to "map" the SqlConnection in each of the page to the setting in web.config right?
How do i achive that ?
-
Mar 14th, 2005, 09:20 AM
#4
Thread Starter
Member
Re: How to change connection string dynamically across ALL pages in VS.NET?
Ok, i have solved it. thanks mendhak.
BUT, is there a piece of code or software that could help me change the connection string in web.config ?
My idea is, I have a project build on machine A.
I want to deploy that project on machine B.
So, i need to change the connection string of the project if the project was to be hosted on machine B.
Is there easier way to accomplish this?
Thanks for ur time
-
Mar 14th, 2005, 11:29 AM
#5
Re: How to change connection string dynamically across ALL pages in VS.NET?
That's about as easy as it gets and is one of the most widely used methods.
-
Mar 14th, 2005, 08:07 PM
#6
Thread Starter
Member
Re: How to change connection string dynamically across ALL pages in VS.NET?
 Originally Posted by mendhak
That's about as easy as it gets and is one of the most widely used methods.
Alright.
Thanks for your help. You save a lot of my time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|