I’m working on a project where I have a local database (SQL CE) which is used as sort of a buffer while no connection to the server exists. On the server I want to use the same database-layout.
Of course I want to use the same EDMX-File which is in a Common.dll available on the Server and the Client.
In the Client I have a connection string with provider=System.Data.SqlServerCe.3.5 while it is provider=System.Data.SqlClient on the server.
My problem comes when I want to save sth on the Server-side: “The provider manifest given is not of type ‘System.Data.SqlClient.SqlProviderManifest’.”
Is there even a chance to use the same EDMX-File on both parts?
Or is there any best practice how to handle such a constellation?
Thank you for your help!
EDIT:
My main Question is: Is it possible to enable an EDMX File to use with different Providers? In my case System.Data.SqlServerCe.3.5 and System.Data.SqlClient!
We have the exact scenario working on a production application. We used a T4 template to generate a SQLCE EDMX file based on a canonical SQL EDMX file. This leaves you with 2 EDMX files which you can switch between when instantiating your single context….
The SQLCE EDMX T4 code looks like this…