How can I switch between 2 Connection Strings in my Web.Config (Activate one for DBML)

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-05-21T21:29:05Z Indexed on 2010/05/21 21:30 UTC
Read the original article Hit count: 409

Filed under:
|
|
|

Hello!

I have two connection strings (both in Web.Config: CS_Local and CS_Production) for my DBML (Linq to SQL).

In my Global.Asax/Application_Start I run some production preparation methods if the request is non-local (!HttpContext.Current.Request.IsLocal). Within that part, I'd also like to change the current connection string used by my DBML from the standard CS_Local to CS_Production.

How would I do that? Some help please..

© Stack Overflow or respective owner

Related posts about c#

Related posts about connection-string