Organizational Research By

Surprising Reserch Topic

linq to sql set connection string dynamically based on environment variable


linq to sql set connection string dynamically based on environment variable  using -'asp.net,linq,linq-to-sql,connection-string'

I need to set my connection string for Linq to Sql based on an environment variable.  I have a function which will return the connection string from the web.config based on the environment variable, but how do I get Linq to always use this "dynamically created" connection string (preferably without having to specify it every time)?

I know I can specify the connection string using the constructor, but how does that work when using the datacontext in a LinqDataSource?
    

asked Sep 21, 2015 by deepak07.s
0 votes
17 views



Related Hot Questions

4 Answers

0 votes
NULL
answered Sep 21, 2015 by gauravg.gwl
0 votes
NULL
answered Sep 21, 2015 by akasati02
0 votes
NULL
answered Sep 21, 2015 by sachin valanju
0 votes
NULL
answered Sep 21, 2015 by deven.bendale

...