Configuring the connection to *.config file

Configuring the connection to *.config file

Postby killpapa » Wed 01 Feb 2012 05:03

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.
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby Shalex » Wed 01 Feb 2012 11:16

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).
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Postby killpapa » Thu 02 Feb 2012 13:22

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.
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby killpapa » Fri 03 Feb 2012 06:42

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?
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby StanislavK » Fri 03 Feb 2012 16:54

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby killpapa » Thu 12 Apr 2012 05:07

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'
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby MariiaI » Thu 12 Apr 2012 12:29

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.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Postby killpapa » Fri 13 Apr 2012 09:55

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?
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby killpapa » Tue 17 Apr 2012 09:46

is anyone alive? 8)
killpapa
 
Posts: 13
Joined: Sun 29 Jan 2012 16:12

Postby MariiaI » Tue 17 Apr 2012 10:58

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.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to dotConnect for Oracle