I have two databases on the web. One has external access and the other does not. If I'm testing local, I want to use one database, and if I push my app the the web, I want it to automatically use the other database. How do I set a definintion in web.config
to swich database if not local in VS10 using C#?
mwesley64
Member
16 Points
35 Posts
Connect to two differnt databases depending upon local or on web ...
Jun 29, 2012 02:56 PM|LINK
Hi Folks,
I have two databases on the web. One has external access and the other does not. If I'm testing local, I want to use one database, and if I push my app the the web, I want it to automatically use the other database. How do I set a definintion in web.config to swich database if not local in VS10 using C#?
Thanks in advance
MattsDotNetU...
Contributor
3178 Points
515 Posts
Re: Connect to two differnt databases depending upon local or on web ...
Jun 29, 2012 03:01 PM|LINK
One way is to use different build configurations with a web.config transform:
http://msdn.microsoft.com/en-us/library/dd465318.aspx