some customers use oracle and some user MS SQL Server

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

some customers use oracle and some user MS SQL Server

Post by estern » Fri 07 May 2010 20:20

Has anyone found a way to manage this? The thought process was one version of the code, two projects, one project with an Oracle model and one with a SQL server model.

The capitilization of the column names has to match to get the binding to work correctly (silverlight) etc. so the two project approach is becoming painful.

Is the Universal product an option - it doesn't state support for the entity framework?

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

Post by AndreyR » Tue 11 May 2010 13:21

Take a look at our EF Query samples here:
http://www.devart.com/dotconnect/efquerysamples.zip
Try differerent naming rules (Model Properties, the Naming Rules tab) to reduce manual naming changes. Please be aware that naming rules are applied only to the objects added to the model after Naming Rules was set (so naming rules setting does not influence the existing model, only new objects).
dotConnect Universal does not give any option to use Entity Framework.

Dominik
Posts: 29
Joined: Wed 19 May 2010 07:26

EF4 with Oracle and SQL Server

Post by Dominik » Wed 19 May 2010 10:31

Hi,

We have the same problem...

We are working in a new N-Layered application with EF4 as ORM. As a requirement, we need to give support for both SQL Server and Oracle existing databases.

Our wish was to build a single EDMX model and then generate our business entities from a TT file.

The main problem was that database providers may generate different .NET types from our database field types. In this case, we'll have different EDMX models and then different auto-generated entities, which is more or less the same as have two different applications.

I don't know if we could have different SSDL files with specific database information (one for Oracle and another one for SQL Server) in separete files and share CDSL and MSL information for both databases.

Would be this solution possible?

Could your sample help us to use Oracle and SQL Server with EF4 indistinctly? Could we use EF4 designer in this way?


Thanks in advance,

Dominik.

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

Post by AndreyR » Thu 20 May 2010 16:33

If you already have two databases, the only way is to create a model from one of them and then make some changes into the second one.
This way will simlify the changes in Entity Developer - Naming Rules can give you an opportunity to have the names in one case.
In case you have different types you can change both conceptual and storage types in design time of Entity Developer for the model.
After this you can simply cut off the SSDL and MSL (if necessary) and add to the first model.
In case you don't have a ready database you can use VS 2010 Model First and generate two databases from the same conceptual model or import one model and generate script for another.

Dominik
Posts: 29
Joined: Wed 19 May 2010 07:26

Post by Dominik » Thu 20 May 2010 19:11

Hi,

Yes, I perform some tests and I think the only way will be to share SSDL and re-create SQL server tables with all right types.

Anyway, it is possible to create schemas with Entity Developer including automatic foreign keys relations? I didn't find the way to do it...

Thanks in advance,

Dominik.

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

Post by AndreyR » Fri 21 May 2010 16:05

Go to Model Properties and select the "Include foreign key columns in the model" check box.

Dominik
Posts: 29
Joined: Wed 19 May 2010 07:26

Multiple database support with Entity Framework

Post by Dominik » Thu 15 Jul 2010 08:14

Hi again,

Could this technique be applied with Oracle provider?

http://mosesofegypt.net/post/Multiple-d ... ework.aspx

Which should be the ProviderManifestToken attribute value?

Thanks in advance,

Dominik.

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

Post by AndreyR » Thu 15 Jul 2010 10:16

Sure it can. There is no need to set the ProviderManifestToken manually, it is automatically generated both by Entity Developer and ADO.NET Entity Data model wizard.
You can take a look at the implementation of this approach in our Entity Framework Query Samples.

Dominik
Posts: 29
Joined: Wed 19 May 2010 07:26

Post by Dominik » Mon 19 Jul 2010 13:04

Thank you very much.

And what about the Schema property at EntitySet element? What if the name of the database differs in different installations of the application?

Best regards,

Dominik.

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

Post by AndreyR » Mon 19 Jul 2010 13:39

That's a good question. The simplest way to deal with this attribute is to manually delete it from the .edmx file or to delete the schema name from the Schema property in the Store part of the model in the Entity Developer Model Explorer (in case you are using .edml files).
In this case the schema from the connection string is used.

Post Reply