Page 1 of 1
Configuring the connection to *.config file
Posted: Wed 01 Feb 2012 05:03
by killpapa
Hi all!
How can we do purely connection setting in the configuration file? And then I ORM generates the code is tied to the database, and therefore, if you change your address and server name have to rebuild the project, which is not very desirable.
Thanks in advance.
Posted: Wed 01 Feb 2012 11:16
by Shalex
killpapa wrote:How can we do purely connection setting in the configuration file?
Are you using Entity Developer?
Create Model Wizard of Entity Developer (which is built-in Visual Studio) includes the "Save connection settings in App.Config" option.
killpapa wrote:And then I ORM generates the code is tied to the database, and therefore, if you change your address and server name have to rebuild the project, which is not very desirable.
Which ORM are you working with?
The following information corresponds to Entity Framework.
Here are two solutions to avoid usage of schema prefix before the names of database objects in the queries:
1) turn off the generation of the schema name in run-time queries using the IgnoreSchemaName option of EF-provider configuration:
http://www.devart.com/blogs/dotconnect/ ... orkarounds
2) remove Schema attributes from your EntitySets in SSDL (with Entity Developer or with XML Editor).
Posted: Thu 02 Feb 2012 13:22
by killpapa
Shalex wrote:
Are you using Entity Developer?
Create Model Wizard of Entity Developer (which is built-in Visual Studio) includes the "Save connection settings in App.Config" option.
about this I know:)
Shalex wrote:
Which ORM are you working with?
The following information corresponds to Entity Framework.
Here are two solutions to avoid usage of schema prefix before the names of database objects in the queries:
1) turn off the generation of the schema name in run-time queries using the IgnoreSchemaName option of EF-provider configuration:
http://www.devart.com/blogs/dotconnect/ ... orkarounds
2) remove Schema attributes from your EntitySets in SSDL (with Entity Developer or with XML Editor).
I'm using LinqConnectModel.
In the generated ORM functional database name spelled tough on this when you change the connection string in the configuration file to the database (change the name of the database), we have to rebuild functionality to work. And I would like to be limited only to the configuration file.
Posted: Fri 03 Feb 2012 06:42
by killpapa
I'm sorry, was not accurate.
ORM generates a class with a tight coupling to the user in the database, ie If a user A and user B has (by changing the configuration), it would be a mistake. How can I make that would not have generated rigid adherence to a user name?
Posted: Fri 03 Feb 2012 16:54
by StanislavK
By default, Entity Developer includes the database name into the mapping information. This is done to support the case of working with objects from several databases in the same model.
To disable storing the database name, please re-generate your model with the 'Preserve schema name in storage' option disabled. Please tell us if this helps.
JIC: you can disable this option in existing models as well, though this won't affect the mapping of entity classes that are already present in the model.
Posted: Thu 12 Apr 2012 05:07
by killpapa
StanislavK wrote:
JIC: you can disable this option in existing models as well, though this won't affect the mapping of entity classes that are already present in the model.
You could not tell where the option is 'Preserve schema name in storage'
Posted: Thu 12 Apr 2012 12:29
by MariiaI
The "Preserve schema name in storage" option is located on the 'General' tab of the 'Model Settings' dialog box. To open this dialog box, you can, e.g., double-click the diagram canvas.
Posted: Fri 13 Apr 2012 09:55
by killpapa
MariiaI wrote:The "Preserve schema name in storage" option is located on the 'General' tab of the 'Model Settings' dialog box. To open this dialog box, you can, e.g., double-click the diagram canvas.
tnx.
In this case, the user name will be pulled up from the configuration file?
Posted: Tue 17 Apr 2012 09:46
by killpapa
is anyone alive?

Posted: Tue 17 Apr 2012 10:58
by MariiaI
In this case, after disabling the option:
a) the schema name (i.e., the user name) will not be removed from the existing mapping file;
b) the schema name will be removed from the mappings files of new objects;
c) the connection string will not change.