How to connect Visual Studio 2010 Express C# to SQL Server Express

Jeff Dunlop picture Jeff Dunlop · Mar 24, 2012 · Viewed 15.9k times · Source

Is there any real workaround to getting the Express edition of C# connected to database options other than the lightweight options allowed (Access, SQL Compact, or SQL file)? As has been noted elsewhere, it's possible in the web edition to do so. It has also been noted that you can create a project file, open it in the web edition, create a connection, and create a project with your database entities, and then switch back to C#.

However, as a workaround this is quite clunky, as it seems like if I could just get the SQL connection persisted in my C# Database Explorer, which seems to be tied to the application, not any project, then I would permanently be able to add to the database without having to constantly switch back and forth.

Has anyone worked through this problem?

Answer

Jeff Dunlop picture Jeff Dunlop · Mar 26, 2012

I figured out a better workaround. The application settings seem to be saved in [Documents and Settings]\[User]\Application\Microsoft\VCSExpress\10.0 and VWDExpress\10.0. What I found is copying ServerExplorer\DefaultView.SEView from the VWDExpress to VCSExpress after creating the connection in WD worked perfectly. I could from there create new objects, refresh from the data, create a database from the design, etc.