Linq to Sql model & connection string

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Alladin
Posts: 149
Joined: Mon 27 Nov 2006 16:18
Contact:

Linq to Sql model & connection string

Post by Alladin » Thu 24 Jun 2010 10:49

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

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 25 Jun 2010 15:01

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.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 12 Jul 2010 15:05

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.

Post Reply