Configuring the connection to *.config file

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
killpapa
Posts: 19
Joined: Sun 29 Jan 2012 16:12

Configuring the connection to *.config file

Post by 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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by 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).

killpapa
Posts: 19
Joined: Sun 29 Jan 2012 16:12

Post by 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: 19
Joined: Sun 29 Jan 2012 16:12

Post by 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?

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

Post by 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.

killpapa
Posts: 19
Joined: Sun 29 Jan 2012 16:12

Post by 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'

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by 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.

killpapa
Posts: 19
Joined: Sun 29 Jan 2012 16:12

Post by 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: 19
Joined: Sun 29 Jan 2012 16:12

Post by killpapa » Tue 17 Apr 2012 09:46

is anyone alive? 8)

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by 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.

Post Reply