SDF and CE 4 without installing the drivers
If you are using SDF and you want to be able to use it without needing to do an install and you want to use version 4.0, you can do this by following the below simple steps.
The hardest part is getting the DLLS, but all the DLLS are within the GitHub example.

Adding files and structure
First get the 64 and 32 bit DLLS and place them into the root of your project and then move the System.Data.SqlServerCe dll file to the root aswell.
Once placed in the correct structure select all the files and go to the properties and change "Build Action" to content and "Copy to output directory" to copy always.

32 bit dlls
The x86 is the folder within the root folder

x86
- sqlceca40.dll
- sqlcecompact40.dll
- sqlceer40EN.dll
- sqlceme40.dll
- sqlceoledb40.dll
- sqlceqp40.dll
- sqlcese40.dll


64 bit dlls
The amd64 is the folder within the root folder

amd64
- sqlceca40.dll
- sqlcecompact40.dll
- sqlceer40EN.dll
- sqlceme40.dll
- sqlceoledb40.dll
- sqlceqp40.dll
- sqlcese40.dll


Adding the CE reference (System.Data.SqlServerCe )
Now that you have the DLLS in your solution and your have set it to copy on build. Build your solution and once built stop the build.
Then go to Add reference and then click on "browse". Not browse to the solution debug folder and find the System.Data.SqlServerCe.dll file and click add.

Now you are able to publish your solution and use SDF on systems that do not have any CE drivers installed.


Created: 23/10/2018 Total Comment: 0

Comments

(Not Displayed)
Human validation
Enter 2989 number, before submitting to confirm your human
[Home] [All Blogs] [Contact] [Me]