views:

23

answers:

1

I just want to make sure I'm understanding the documentation correctly. If I add System.Data.SqlServerCe as a reference in my Visual Studio 2008 project, compile it, and copy the contents of the "bin\Release" directory to a Windows machine that has the latest version of the .NET framework, will it just work? Or do I need to do something else?

+1  A: 

The answer is definitely "no".

In addition to adding a reference to System.Data.SqlServerCe to any project that uses SQL Server CE, the following DLLs need to be included (not referenced but copied into the output directory using [Build Action = Content] and [Copy to Output Directory = Copy if Newer]):

  • sqlceca35.dll
  • sqlcecompact35.dll
  • sqlceer35EN.dll
  • sqlceme35.dll
  • sqlceoledb35.dll
  • sqlceqp35.dll
  • sqlcese35.dll
  • System.Data.SqlServerCe.Entity.dll

These DLLs can be found in the following location (Windows XP): C:\Program Files\Microsoft SQL Server Compact Edition\v3.5

These should be installed by default when you install Visual Studio.

Note: To avoid "uglifying" my projects that use SQL Server CE, I created a separate "SqlServerCeLibrary" project that just has these DLLs in it. This way, I can just add SqlServerCeLibrary as needed to my solutions, and the DLLs will be copied into the correct directory in the "bin" folder. You can also add the ouput from SqlServerCeLibrary to an installer.

DanM
Keep in mind that there are 2 sets of DLL files, one is for x86 and one is for x64, see this for clearer instructions: http://blogs.msdn.com/b/stevelasker/archive/2008/10/22/privately-deploying-sql-server-compact-with-the-ado-net-entity-provider.aspx
ErikEJ