PC Review


Reply
Thread Tools Rate Thread

Different SQL Server versions and Entity Framework (ProviderManifestToken)

 
 
Ralf Kaiser
Guest
Posts: n/a
 
      21st Oct 2008
Hi,

i have a configuration where i use MS SQL Server 2008 Express on the
development machine and MS SQL Server 2005 Express on the real server with
the entity framework.

Whem working with different datatypes (datetimes for example) that can cause
problems because the EF uses the SQL datatype "DateTime2" which is not
supported by the MS SQL Server 2005 Express. I get errors on runtime when
accessing the tables that contain those types.

After a little while of googling i found out that the "*.edmx" files contain
a parameter "ProviderManifestToken" that can be set to "2005" to keep the
data model compatible with MS SQL Server 2005 Express. That works very good,
after a recompile of the application the errors are gone. Fine.

However, every time i refresh the data model form the database (tables
added/changed) VS changes "ProviderManifestToken" back to its original value
"2008". So if i forget to edit this value before publishing the application
i will have the runtime error back. Sigh.

Is there any way to set "ProviderManifestToken" to a FIXED value that VS
will not touch when refreshing the data model?

Thanks in advance,
Ralf

 
Reply With Quote
 
 
 
 
Gregory A. Beamer \(Cowboy\) - MVP
Guest
Posts: n/a
 
      24th Oct 2008
None that I know of. This is an attribute that gets set in the SSDL. You can
create a VS addin that turns all SSDL files to the 2005 setting.

Unfortunately, I do not know a way to set this at runtime, as the classes
generated are done automagically behind the scenes.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Ralf Kaiser" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> i have a configuration where i use MS SQL Server 2008 Express on the
> development machine and MS SQL Server 2005 Express on the real server with
> the entity framework.
>
> Whem working with different datatypes (datetimes for example) that can
> cause problems because the EF uses the SQL datatype "DateTime2" which is
> not supported by the MS SQL Server 2005 Express. I get errors on runtime
> when accessing the tables that contain those types.
>
> After a little while of googling i found out that the "*.edmx" files
> contain a parameter "ProviderManifestToken" that can be set to "2005" to
> keep the data model compatible with MS SQL Server 2005 Express. That works
> very good, after a recompile of the application the errors are gone. Fine.
>
> However, every time i refresh the data model form the database (tables
> added/changed) VS changes "ProviderManifestToken" back to its original
> value "2008". So if i forget to edit this value before publishing the
> application i will have the runtime error back. Sigh.
>
> Is there any way to set "ProviderManifestToken" to a FIXED value that VS
> will not touch when refreshing the data model?
>
> Thanks in advance,
> Ralf
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Entity Framework - entity with multiple foreign keys to same table CGatto Microsoft ADO .NET 1 7th Aug 2009 07:51 PM
Entity Framework for SQL-Server && ORACLE jasc Microsoft C# .NET 1 2nd Aug 2009 10:31 PM
Entity Framework - Reassigning child entity's parent Norm Microsoft ASP .NET 3 6th Jul 2009 08:28 PM
Enforcing triggers in sql server database while using entity framework Andy B Microsoft ASP .NET 1 26th Jan 2009 03:18 AM
Entity Framework DDL: Creating a new table in SQL Server using EF Abbas Microsoft ADO .NET 0 13th Jan 2009 07:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:05 PM.