Using same EDMX file for different schema

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rranjan325
Posts: 4
Joined: Mon 06 Jul 2009 10:33

Using same EDMX file for different schema

Post by rranjan325 » Fri 10 Jul 2009 12:10

I have two databases with same Tables/Functions/Procedures etc. When I use same schema name in both databases then the EDMX does fine (Same EDMX can be used for both database by changing the connection string).

But, when the schema name (username in case of oracle 10g) is different then it gives me the compilation error.

Is there any way to use same EDMX file with different schema names? I wanted to use same database with two different schemas for two users so that both users can add/edit data only in their schema space.

Any help will be greatly appreciated.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 10 Jul 2009 12:49

You should remove Schema attribute from your .edmx file (use XML Editor to edit it).
Also, you'll have to remove the schema name from DefiningQueries and CommandTexts, if you have any in your model.
After performing these actions you should be able to switch between the contexts
simply creating a new instance of the context with proper connection from your configuration file.

rranjan325
Posts: 4
Joined: Mon 06 Jul 2009 10:33

What will happen when we update schema again?

Post by rranjan325 » Fri 10 Jul 2009 13:15

Thanks for your suggestion.

But, the problem is whenever I take an update of the EDMX from database then the EDMX will be regenerated and hence the schema information comes again. So, again I will not be able to switch between users.

Is there any permanent solution?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 13 Jul 2009 06:37

Yes, Update model from database wizard discards changes made to the model.
As an alternative, you can use Entity Developer to generate the model.
The Store part of Devart Entity model is fully editable in design time.

Post Reply