in recent projects need to use embedded database, we choose the data Development Framework is pdf.net (http://www.pwmis.com/SqlMap/), The previous blog post has been summed up to let Pdf.net support the latest sqlite, today we summarize how to let pdf.net support different versions of the SQL Server Compact database. Pdf. NET supports most of the mainstream databases, the SQL Server Compact is no exception, but pdf.net only supports SQL Server Compact 4.0, and the SQL Server Compact is not backwards compatible, to enable pdf.net to support SQL The Server Compact 3.5 requires that the source code be re-modified and compiled.
The method of modification is very simple, download Pdf.net source code (http://www.pwmis.com/SqlMap/), Locate the Pwmis.core project and find the System.Data.SqlServerCe in its project reference, and you will find that the DLL is pointing to version 4.0, so that it can support version 3.5 as long as the DLL is replaced by 3.5.
PDF. NET connection string for the SQL Server Compact is
<connectionStrings>
<add name= "Default" connectionstring= "Data source=.\n.sdf; Persist Security info=true "Providername=" Pwmis. Dataprovider.data.sqlserverce,pwmis. Core "/>
</connectionStrings>
Note that at the time of deployment, the computer to install the SQL Server compact corresponding program, although there are articles on the Internet that can not be installed, but I measured it myself, or to install.
I found that there is no support like the local Database cache in the version after VS2012, fortunately I found an open source project, is to achieve a similar function, here to provide the address HTTP// sqlcetoolbox.codeplex.com/