Page 1 of 1

Linq to Sql model & connection string

Posted: Thu 24 Jun 2010 10:49
by Alladin
Hello there,

How do I specify connection string name taken from App.config using Entity Developer.

Generated data context file always includes complete connection string rather than connection string name in app.config.

Thank you in advance

Posted: Fri 25 Jun 2010 15:01
by StanislavK
Actually, the connection string specified in the app.config file is used in the code generated for the model. We will analyze the situation with the connection string hardcoded in the .lqml file and inform you about the results.

Also, you may change the connection used by the data context at run-time, e.g., by using the %ModelDataContext% constructor that takes an IDbConnection argument.

Posted: Mon 12 Jul 2010 15:05
by StanislavK
Though the connection string from app.config is used in the model, we keep the hard-coded connection string to make the model self-sufficient. Also, standard Linq models deal with connection strings in the same way.