Page 1 of 1

some customers use oracle and some user MS SQL Server

Posted: Fri 07 May 2010 20:20
by estern
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?

Posted: Tue 11 May 2010 13:21
by AndreyR
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.

EF4 with Oracle and SQL Server

Posted: Wed 19 May 2010 10:31
by Dominik
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.

Posted: Thu 20 May 2010 16:33
by AndreyR
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.

Posted: Thu 20 May 2010 19:11
by Dominik
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.

Posted: Fri 21 May 2010 16:05
by AndreyR
Go to Model Properties and select the "Include foreign key columns in the model" check box.

Multiple database support with Entity Framework

Posted: Thu 15 Jul 2010 08:14
by Dominik
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.

Posted: Thu 15 Jul 2010 10:16
by AndreyR
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.

Posted: Mon 19 Jul 2010 13:04
by Dominik
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.

Posted: Mon 19 Jul 2010 13:39
by AndreyR
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.