views:

155

answers:

1

Is there any backward compatibility in the entity framework between SQL Server 2008 and 2005?

It seems the framework forces you to use the same provider for all the .edmx files in a solution.

If you use the 2008 provider, data types like DateTime2 and functions like SysDateTime that are emitted by the framework to the underlying SQL query make it useless to use them against a SQL 2005 Server.

Any way around this?

A: 

Did you set the ProviderManifestToken in the EDMX to 2005? If you intend to support 2005, you should. If you design your EDMX using a 2008 server, the GUI designer will optimize the model for 2008, including data types and query syntax. If you design your EDMX against a 2005 server, only 2005-compatible types will be used, and the ProviderManifestToken will be set to 2005.

Craig Stuntz
I agree. But in my situation, we need to support both sql server 2005 and 2008. To maintain separate builds for each of them seems too much when I would have been able to support both the databases without any problems if I have written my own data layer instead of using the entity framework.There should have been a configurable property that should allow for backword compatibilty.
shake
**You don't have to do two builds.** There already is such a property. I even gave you a link to it in my reply. Set it to 2005 and your app will work with both 2005 and 2008.
Craig Stuntz
Yeah you are probably right. I think I got my error because I was trying to update the model using sql server 2008 with ProviderManifestToken set to 2005. Just querying should not give me any grief. Thanks
shake