SQL CE request ASP.NET Full Trust. By default your account should be on FULL Trust. If you're on medium trust server, you'll need to migrate to a Full Trust server first.
We support the latest version of SQL CE,to use SQL CE please follow the steps below:
1. Download SQL CE at http://www.microsoft.com/download/en/details.aspx?id=17876
2. Install it!
3. Go to C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private,Copy the following files into your BIN folder:
System.Data.SqlServerCe.dll
System.Data.SqlServerCe.Entity.dll
4. Go to C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\x86,copy the following files into your BIN folder:
sqlceca40.dll
sqlcecompact40.dll
sqlceer40EN.dll
sqlceme40.dll
sqlceqp40.dll
sqlcese40.dll
5.Go to C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\x86\Microsoft.VC90.CRT,copy the following files into your BIN folder:
Microsoft.VC90.CRT.manifest
msvcr90.dll
6) In your Visual Studio, The reference System.Data.SqlServerCe needs to change 'Copy Local' from false to TRUE.
7) Recompile and publish
That's all! SQL CE should now work and beable to run on your smarterasp.net hosting account.
Note: SQL Server Compact Edition cannot work well with Windows Server 2016, getting error
[SqlCeException (0x80004005): Unspecified error [ sqlcese40.dll ]]
System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent) +2193
System.Data.SqlServerCe.SqlCeConnection.Open() +47