MSSQL + Oracle

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
estern
Posts: 19
Joined: Tue 27 Jan 2009 18:59

MSSQL + Oracle

Post by estern » Wed 28 Jan 2009 00:06

Does anyone have a good strategy for creating one entity framework that supports customers on Oracle or MS SQL?

Thanks

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

Post by AndreyR » Wed 28 Jan 2009 15:35

You can refer to our EFQuerySamples. They are available here:
http://devart.com/dotconnect/efquerysamples.zip
These samples use the same CSDL and MSL and differ only in the SSDL part of .edmx file. You can design your model in similar way,
having identical CSDL and MSL layers and the provider-specific SSDL layer.

_andreas
Posts: 6
Joined: Wed 18 Mar 2009 09:53

Post by _andreas » Mon 23 Mar 2009 09:47

How do you solved the problem of uppercase table and column names in oralce?
This problem drives me to distraction.

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

Post by AndreyR » Mon 23 Mar 2009 12:44

Try Entity Developer 2.0 Beta. It can work with Entity Framework models and has Naming Rules for setting the needed case.

robymes
Posts: 29
Joined: Tue 09 Sep 2008 09:46

Post by robymes » Tue 24 Mar 2009 13:23

you can also use a strategy with only one csdl (obviously) and msl+ssdl for sqlserver and oracle (5 files).

fcorreia
Posts: 5
Joined: Mon 20 Apr 2009 08:38

Post by fcorreia » Mon 20 Apr 2009 09:09

These CSDL, MSL and SSDL, you generate them with Entity Developer from Devart?

Any sugestion for the source database from where you generate your .cs? Asking this because of different mapping of types in Oracle and SQLServer.

In any way (futurely) will you make it possible to change the model from Oracle to SQL Server without have to make a new model based on SQL Server? Like, I change the connection and the model "refresh". Off course we map the same tables in both sql server and oracle.

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

Post by AndreyR » Wed 22 Apr 2009 13:53

Thank you for the suggestion, we will investigate the possibility of adding such functionality.

slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

Can we store SSLDs as 'embedded resource'

Post by slaxman » Fri 09 Oct 2009 21:06

The samples save these SSDLs in the 'Schemas\ folder. Is it possible to keep them as 'Embedded Resources' instead?

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

Post by AndreyR » Mon 12 Oct 2009 10:26

Sure you can.
But please don't forget to change the connection strings accordingly.

slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

exception while using Embedded Resource

Post by slaxman » Mon 12 Oct 2009 20:39

when I do that I get an exception.

EXCEPTION (System.Data.MetadataException): Unable to load the specified metadata resource

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

Post by AndreyR » Wed 14 Oct 2009 12:20

Please change the entity connection string to point on the generated resources, like this:

Code: Select all

metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...
and check that the names of the resources embedded into your assembly coincide with the names
you have written in your connection string.

slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

overriding the SSDL

Post by slaxman » Wed 14 Oct 2009 13:24

this works fine. But the error shows up when I override the SSDL with a diff. name. For example...

metadata=res://*/Model1.csdl|res://*/Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...

however, if I use it as a file instead of embedded resource it works. For example...

metadata=res://*/Model1.csdl|Model2.ssdl|res://*/Model1.msl;provider=Devart.Data.Oracle;provider connection string=...

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

Post by AndreyR » Thu 15 Oct 2009 08:57

Please note that Entity Framework may generate a resource with a name that differs from the model name.
To check the name generated, simply view the generated assembly using any tool that enables resource
viewing, for example .NET Reflector.
Also please check that the Build Action for the Model2.ssdl file is set to Embedded Resource.

slaxman
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

entity name has the assembly ns too

Post by slaxman » Mon 19 Oct 2009 13:30

you are right. visual studio added the assembly namespace also. Is there a way to tell VS not to do that? btw, it does not do that for the components within the EDMX file. I am guessing that's because of the 'EntityDeploy' custom action.

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

Post by AndreyR » Tue 20 Oct 2009 08:56

I am not aware of any way to overcome this situation.

Post Reply