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 16, 2015 by gauravg.gwl
0 votes
15 views



Related Hot Questions

4 Answers

0 votes
NULL
answered Sep 16, 2015 by vijaygupta1980
0 votes
NULL
answered Sep 16, 2015 by tushar2k6
0 votes
NULL
answered Sep 16, 2015 by jekbishnoi
0 votes
NULL
answered Sep 16, 2015 by vickeykumar66

...