Local Database Cache Exception Sussed

| 1 Comment | No TrackBacks

If you’re using the Visual Studio 2008 (SP1) Data Source Wizard or Local Data Cache wizard and you get a message like this:

Synchronizing the database failed with the message:
'Unable to initialize the client database, because the schema for table ...[list of tables]... could not be retrieved by the Getschema() method of DvServerSyncProvider.

Be sure to check the compatibility level of the targeted database to make sure it’s set to SQL Server 100 (2008). This should have been tested before the database was listed as supporting automatic sync support, but in any case, the exception message should show the reason for the error, not the cause.

image

To set a database’s compatibility level, open SQL Server Management Studio, open the database and choose Properties | Options. Use the drop-down to choose the right compatibility level. Of course, this assumes that the database is closed elsewhere (like in the Visual Studio Server Explorer). Once you change compatibility level, the engine rechecks the schema etc. to make sure there aren’t any compatibility issues.

Also, make sure you try to compile your project with x86 or x64 explicitly. I’ve discovered some disconnects with the default <AnyCPU> configuration setting. You can ignore the warnings when using x64 that complain that mscorlib.dll, system.data.dll and system.transcations.dll target a different processor. This is a known bug.

In some cases you might have to get the Local Data Cache wizard to rebuild the .SDF cache database to properly sync with the server-side table(s). Simply open the LocalDataCache.sync and make a property change and set it back once the sync has completed.

 

hth

 

No TrackBacks

TrackBack URL: http://betav.com/blogadmin/mt-tb.cgi/2340

1 Comment

I choose the compatibility level form the drop down menu, but as soon as I choose it, it disappears and everything looks as before.

Leave a comment

Pages

Powered by Movable Type 4.38

About this Entry

This page contains a single entry by William Vaughn published on January 30, 2009 3:21 PM.

Beta V Has Come Up in the World—We’re #2 was the previous entry in this blog.

Visual Studio Magazine—Letter to the Editor is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.