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? :wave:
Re: How to change connection string dynamically across ALL pages in VS.NET?
Re: How to change connection string dynamically across ALL pages in VS.NET?
Quote:
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 ?
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 :)
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.
Re: How to change connection string dynamically across ALL pages in VS.NET?
Quote:
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. :)