convert .mdf 2008 file to .mdf2005 file - visual-studio

I made a project in visual studio 2008 and attached a database to it...
But later on it installed visual studio 2010 and it automatically updated my project...
As now i reinstalled my windows and again approched to my project, it showed the following message when i double clicked my database file in the server explorer in vs 2008, vs 2008 sp1, vs 2010...

The only way to downgrade your database for SQL Server is to script out all the objects to recreate your schema on a previous version and bulk export/ import the data. Alternatively refer to backups.

Related

Cannot open database.mdf after opening in Visual Studio 2012

Ive been working on some stuff with Visual Studio 2008, and SQL 2008 aswell..
Then i opened the project on another computer with 2012 version.
And now when im trying to work with the files in 2008 again, i cant open my database.mdf, becouse the 2012 sql has upgraded my database file...
Anything i can do to save it?
(Btw. the data aint that important, but more the whole table setup and relations)
Install 2012 SQL Server Express with Management tools, attach the MDF and extract the schema by generating "create" scripts for the objects you want using the wizard, then re-run the scripts on the new 2008 DB, don't think there's a way to downgrade. See here.
Or you can just keep developing on top of SQL2012, shouldn't be a problem even if you use visual studio 2008.

Visual studio wont open mdf file

The problem I have is that I'm unable to open my mdf file in Visual Studio 2010. I installed VS2010 along time ago, but just installed SQL server 2008 R2 few days ago.
I made the file in VS2010 and then attach it to SQL server in Management Studio to run a script I have to create all tables and such.
I then detach it in Management Studio and try to view it in VS2010 and get an error telling me that I cannot open database version 661. I can only go as high as 655.
I know this is because VS2010 is using SQL server 2008, but Management Studio is SQL Server 2008 R2.
How can I make VS2010 compatible with SQL Server 2008 R2?
You simply need to upgrade the local version 2008 Express to R2. You'd be able to open your file after that.
I had this problem too, but my problem was solved when I did this:
When you are opening SQL Server Managemnt Studio, in the connect to server window, type "\SQLEXPRESS" after the server name (your server name\SQLEXPRESS), then attach your database. When you detach it, it is compatible with VS2010. I hope this helps you.

How do I convert a Visual Studio 2010 database project to an SSDT Project

I have a clean install of windows 7 with Visual Studio 2010 Premium inc. SP 1. I also just installed the developer edition of SQL Server 2012 .
I now should be able to convert the Visual Studio 2010 database project to an SSDT project. According to this technet blogpost it should be as easy as opening my Visual Studio solution file and follow the conversion wizard. The problem is that the conversion wizard never appears. Also, the "Convert to SQL Server Database project..." context menu item does not exist when right clicking on the VS 2010 database project.
I'm probably missing something in my SQL 2012 installation. The question is: what?
My SQL 2012 install configuration:
In case it helps someone else.
In my case I did not get a wizard of any kind, even though I did ALL necessary installs.
Symptoms:
Open solution in VS2012.
Database project is unloaded, it says it needs migration.
Reload database project, it says it requires functional changes (or something like it). I press OK.
Database project is available, it builds, but when I close VS2012, and re-open the solution, it says the same thing over and over again.
Solution:
Unknown to me VS2012 does create a new project of ssdt type. Unfortunately it doesn't load it. I have a project .dbproj file and a project .sqlproj file. The .dbproj file is loaded.
Remove the database project from the solution.
Add existing project -> select the .sqlproj file. The database project is loaded again. It builds.
Now everything seems well, I can open and build the solution in VS2012 without any problems. Also, I can reopen the solution in VS2010SP1, and it opens and builds without any problems.
Found the problem. Apparently I still needed to download SSDT standalone from http://www.microsoft.com/web/gallery/install.aspx?appid=SSDT. Althought SQL Server Data Tools is listed in the screenshot above.
EDIT: Updated the link. Thanks #ryanwebjackson
If you have a situation where you're trying to migrate from .dbproj created for Visual Studio 2008 to .sqlproj for Visual Studio 2012 you might run into same behavior (no wizzard, can't load project).
In my case there was even quite absurd situation where Visual Studio 2012 created .sqlproj file and copied into it the contents of old Visual Studio 2008 .dbproj.
None of the proposed workarounds helped, I had to first convert from 2008 .dbproj to 2010 .dbproj (using Visual Studio 2010) and then from 2010 .dbproj to .sqlproj (using Visual Studio 2012).
For me something diffrent works.
After migration you will have both *.dbproj and *.sqlproj in project directory.
Just remove project (dbproj and attach existing sqlproj project).
Do not know why solution file is not updated.

Unexpected error when trying to connect to database in Visual Studio 2010

The problem:
In Visual Studio 2010 Professional I choose Server Explorer and right-click on Data Connections to choose "Add Connection". Then I get this error:
An unexpected error occurred in the
.NET Framework Data Provider for
Microsoft SQL Server Compact 3.5.
Please contact the provider vendor to
resolve this problem.
My enviroment:
Windows 7 SP1
Visual Studio 2010 Professional (trial version)
SQL Server 2008 R2 Express
I've tried
Installing Visual Web Developer Express (gives the same problem)
Reinstall of VS 2010 Professional
Reinstall of Sql Server 2008 R2 Express
Tools => Import and Export Setting => Reset all Settings
Run: Devenv.exe /ResetSkipPkgs
Comments
Maybe the registry is messed up in some way.
One post:
http://social.msdn.microsoft.com/Forums/en/vstsstart/thread/b6f7fc36-5a34-4166-9e75-7ac39993182b
says that I should modify the registry at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders
But I don't even have a folder named DataProviders in the 9.0 (or 10.0) folder. So maybe that's a problem.
Thanks for any help!
I started "add and remove programs" and removed everything that was named something about "Visual Studio". Then I reinstalled Visual Studio 2010 Professional. And now it works!
I had to do the same and use the VS 2010 uninstall utility to remove everything, then reinstall it all. This was caused by ODP for .Net which didn't install properly and I could not connect to data sources and basically meant I could not edit the dataset file!

Visual Studio - MDF File - Data provider could not be loaded

I have an MDF File in a Visual Studio project.
On my laptop, I can double click on this, and it opens up in a Visual studio window, in Server Explorer.
If I try this on my pc in the office, i get "Data provider identified by Guid '' could not be loaded
I've just re-installed VS2010, to no avail.
SQL Express 2008 is installed and working.
Any ideas?
I've come accross a solution that worked for me. I had this problem with an .sdf file (SQL Server Compact Edition).
Close all instances of Visual Studio;
Edit %AppData%\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView (could be under '%AppData%\Roaming')and remove the connection with the wrong Provider. If you do not know which of the provider is failing, simply delete the file
Open Visual Studio and try to open your .mdf or .sdf file
This solution come from this site: http://connect.microsoft.com/VisualStudio/feedback/details/552006/unable-to-create-data-connection-in-server-explorer

Resources