Tuesday, April 29, 2008

Develop SQL Server Compact 3.5 apps with VS 2005

UPDATE 01 June 08: This is quite confusing but you can use VS 2008 RTM to manipulate a SQL Server Compact 3.5 database but not SQL Server 2008 database unless you install the newly released VS 2008 Beta Service Pack 1: http://simonrhart.blogspot.com/2008/05/visual-studio-2008-and-net-framework-35.html

I see this question asked all the time in the community, "Can I use SQL Server Compact 3.5 with Visual Studio 2005" the answer is Yes.

Although it is a little bit ugly, but does work. You have to explicitly add the SQL Server Compact manually by clicking on the Browse tab in Add Reference dialog if it doesn't exist in the .NET tab. Of course the limitations are not being able to use Server Explorer in VS 2005 for v3.5 databases and any UI tools that help with data binding etc (as if anyone actually uses these for corporate LOB apps!).

You can use SQL Server Management Studio 2008 to manipulate the SQL Compact 3.5 database or if you haven't got SQL Server 2008 as SQL Server 2008 is not in RTM yet then you can use Visual Studio 2008 Server Explorer to do this.

You can find SQL Server 3.5 engine here(or similar): C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Devices.

See here for the reasons why you might want to move to SQL Server Compact 3.5 and how to get it.

1 comment:

Anonymous said...

Hi Simon,

Thanks for the information. I have a question though, How to get SQL Server compact 3.5 available for developing native C/C++ applications from VS2005?

My understanding is that the the "Add Reference" to System.Data.SqlServerCe.dll is for developing Managed applications from VS2005.
Please correct me if I am wrong.

For Native application development how do I achieve compatibility of SQL Server Compact 3.5 with VS 2005?