SQL Compact 4.0 can't open/read sdf file - visual-studio-2010

I've installed SQL Compact 4.0 CTP 2 via WPI and used NUPack to add SQLCE.EntityFramework in my project.
It compiles and run perfectly but I can't open the SDF file in Visual Studio 2010's Server Explorer.
When I try I always receive the following message:
Microsoft Visual Studio
This is not a valid SQL Server Compact Database file or this file version is not supported by current SQL Server Compact Engine.
OK
I've already tried to uninstall and reinstall everything.
It cannot be opened in SQL Server 2008 R2 Management Studio also.
Please help!!

Installing this (Visual Studio 2010 SP1 Tools for SQL Server Compact 4.0) fixed this exact problem for me perfectly:
http://go.microsoft.com/fwlink/?LinkId=212219
Props to ErikEJ from this thread:
http://forums.asp.net/t/1811963.aspx/1

I met the same problem while trying to follow up the tutorials of MVC3 (MvcMovie) provided by asp.net when I was told to double click the "Movies.sdf" file to check out the tables or other infos.
Acturally the solution is just below the request:
Note If you get an error when you double-click Movies.sdf, make sure
you've installed SQL Server Compact 4.0 (runtime + tools support).
(For links to the software, see the list of prerequisites in part 1 of
this tutorial series.) If you install the release now, you'll have to
close and re-open Visual Web Developer.
After Sql Server Compact 4.0(runtime+tools support) installed, the problem is solved.

This question is a bit old. But I think the answer is that VS2010 SP1 has SQLCE 3.5 and SQLCE 3.5 x64 only, and not SQL Compact 4.0. The SQL products come together with Studio. There is still no SQLCE 4.0 today in 2012 included in distribution of Studio 2010 (I use Express edition).
This version packaging is not direct root cause, but just a clue, that different version will need extra effort.
The fix should involve registration of "Data Provider" in .NET Framework used by Visual Studio.
Look at "DbProviderFactories" inside c:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config. This section describes what data providers can be used by .NET and Studio.
If there is unexpected entries there, try to repair framework or register providers manually. To do so, some low level registration tools will be required. Say for asp.net providers there is aspnet_regsql.exe etc. But for just SQLCE itself there must be something similar.
<system.data>
<DbProviderFactories>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
The difference between broken Studio and working App is that both use the same Framework but have different providers in config. (Or app uses other technique to pick a DLL and open SDF)
Answer: Since SP1 it is officially possible to use SQLCE4.0 in Studio 2010 SP1 (Thanks to Nathan Fisher for link http://support.microsoft.com/kb/983509 )

Related

Porting Visual Studio VSPackage to SSMS 2012 or 2014

I recently discovered an extension for visual studio that allows you to specify a watermark for the code window. This extension can be found on github here.
https://github.com/nategreenwood/VSEditorBackgroundChangerExtension
As part of a small project I am attempting to get it to work on SQL Server Management Studio. While Microsoft doesn't officially support extending SSMS - they also do not discourage it. Those are their words, not mine.
Looking into the extension\application sub folder under SSMS for SQL Server 2014 it is obvious that Microsoft uses VSPackage to include their own extensions to the Isolated Shell version of Visual Studio that SSMS is built on top of. The manifests appear to be version 1 manifests however.
These show up in the following location on my own box:
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Extensions\Application
Looking for assistance in verifying if this extension can be modified to work with SSMS. I have modified the package manifest in a variety of ways - including rewriting the package as a version one style package and manifest. I can see the package registered under the pkgdef guid that VSIX generates. It says it has been installed. No error messages are thrown, but no image appears either.
Does the Isolated Shell and more specifically, the code window utilized by SSMS to develop and execute TSQL support adornments such as the ones used by this package? Does SSMS support version 2 manifests and VSPackages?
Any advice on how to modify this package to get it to work is appreciated.
My own attempts are further documented here: http://sqljudo.wordpress.com/31-days-of-ssms/ssms-day-30-vspackage-and-ssms/
Looks like there was an official Connect answer on this: https://connect.microsoft.com/SQLServer/Feedback/Details/2602390
In 2012 and 2014 the old "Addin" mechanism needs to be used, and as of 2016 (general release) the new "VSPackage" mechanism needs to be used (ref: http://blogs.sqlsentry.com/aaronbertrand/plan-explorer-add-in-ssms-2016/ )

Replace Devart DotConnect with MySQL Connector / Net - Visual Studio 2010

I am working on a Visual Studio 2010 Solution. This solution is a web-site comprised of multiple web apps (using JavaScript, ASP, etc.).
Every time I compile, I get an error message stating that my DotConnect trial has expired.
Instead of forking out the cash, I would like to use the MySQL Connector / Net and replace all instances of DotConnect with instances of MySQL Connector / Net.
Can anyone help me with this task please?
Ended up having to install everything on entirely new computer. Then I imported the source code files and did a find/replace to replace all references from the old connector to the new one. Turns out visual studio is picky. Depending on your 'References' you may have issues if your version of MS Office doesn't match the source code.
Good luck if you're having the same issue.. smh :/

Unable to open SQL CE 4 databases in VS 2010 SP1

According to "The Gu", in VS 2010 SP1 (http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx) I should be able to open SQL CE 4 databases.
However, when I try to do this I get the following error:
"The data provider required to connect
to the local data file could not be
found. The file be added to the
project by the typed DataSet
associated with the file will not be
generated"
followed by the error:
"The operation could not be completed"
Note that this is for an ASP.NET MVC Project.
There are some limitations in the SQL Compact 4 provider tooling, described here (under Scenarios not enabled by SQL Server Compact 4.0) - http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx
In addition to the service pack, you must install the SQL Server Compact 4 tools on top - http://erikej.blogspot.com/2010/12/visual-studio-tools-for-sql-server.html
My "solution" was just to open the database in web matrix to alter the schema.
Perhaps this was just an issue with the beta of VS 2010 SP1.

Visual Studio 2010 Premium is giving me a "Cannot Create Window" error!

When I first launched the Visual Studio (I just installed it) I choose the default programming layout (Visual C#/Visual Basic.NET/ F#/etc) as Web Development. It gave some error that it couldn't find the layout scheme or something and now it says Cannot Open Window.
Is there some way to reset the selected layout option?
I has the same error when I installs MySql Net Connector mysql-connector-net-6.3.4.msi
I think that this installer corrupt my VS 2010. But NOT.
Previous, I uninstall MySql Connector 6.3.2 and edit machine.config... this was the error!
<system.data>
<DbProviderFactories>
<!-- !!! aƱadido a mano para poderlo usar en VS2010
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net
Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,
MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> -->
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories>
</system.data>
The logic comments not is OK. Then, I erase all commented code and VS2010 come to the live, again!
In my lab the Visual Basic was working fine last semester, but this semester got that "Cannot create the Window" message. After trying reinstalling the VB, Visual Studio, .Net, and other things always got same message. Found a site that mentioned missing windowscodecs.dll file in the windows\system32 directory, but I had the file. Found a different date on file on machines witch the VB was working. Copied the newer windowscodecs.dll file, and that got rid of the problem, but later found I also had to copy the windowscodecsext.dll file as well.
Am now doing a comparison between the two systmes using sigcheck on all the files in system32. Have found a large number that report the Signing date: 12:07 PM 4/14/2008, but the other system has Signing date: 12:13 PM 4/14/2008. Haven't checked the actual contents to see how different the files are. Would be nice if there was a method to check and update to the latest versions.
I've had a similar problem with Visual Studio 2010 Express - restarting the computer solved it.
Similar error message here when starting up a freshly installed VS2010 Premium.
I had copy pasted stuff from old machine.config, but accidentally left out one Section-definition. Fixed by adding the missing definition into configSections-block.
Problem might be due to some issue in machine.config. Try to replace the config with the original and try.
This resolved for me.

Is anyone aware of an Object Manager Enterprise plugin for Visual Studio 2010?

I'm using DB4O on a new project I'm playing with and it would help me no end if I was able to use the Object Manager Enterprise utility. I understand it's only available as a VS plugin, so does anyone know whether such a plugin is / will be available for Visual Studio 2010, or is there another way to get the utility?
Currently there's no Object Manager version available for Visual Studio 2010. =(
A few suggestions for alternatives:
When you still have Visual Studio 2008 or 2005 installed, you can use the existing Object Manager for these versions.
You can use LINQPad for db4o as suggested here on SO. However this only works together when you load your domain model into LINQPad
You could use the Object Manager plugin for Eclipse. This version is distributed with the Java-version of db4o. So you need to download Eclipse and the java-db4o distribution. However this version of the Object Manager doesn't fully understand the .NET types, so some object are correctly displayed.
OME will be available for VS2010 when we introduce .Net 4.0 support.
Meanwhile you can try to install the OME that comes with db4o .Net 3.5 package and change the configuration file OMAddin.AddIn from "%mydocuments%\Visual Studio 2008\Addins\" to "%mydocuments%\Visual Studio 2010\Addins\" (if this folder doesn't exist just create it)
Then, open OMAddin.AddIn and change the line:
<Version>9.0</Version>
to
<Version>10.0</Version>
Now after starting VS 2010 OME should work and you should be able to see its toolbar (I have this procedure with VS 2010 beta2 and it worked).
Best
Adriano

Resources