How to create a SQL Compact 3.5 database for Windows Mobile in an ASP.NET web application?

You will need at least the System.Data. SqlServerCe assembly. That is normally in the GAC but it might be usable as a locally copied DLL From there on you can instantiate a SqlCeEngine object and use CreateDatabase() Here is some CodeProject example code in VB.NET.

You will need at least the System.Data. SqlServerCe assembly. That is normally in the GAC but it might be usable as a locally copied DLL.

From there on you can instantiate a SqlCeEngine object and use CreateDatabase() Here is some CodeProject example code in VB.NET.

Essentially Henk's answer points in the right direction. But there are some caveats. The SQLServerCE assembly throws runtime errors.

I found these two helpful links: SQL Server Compact Edition under ASP. Net and IIS (Steve Lasker's blog) Using SQL Compact Edition Under ASP. NET by Geoff Lane In order to use the assembly, you have to call this method: AppDomain.CurrentDomain.

SetData("SQLServerEverywhereUnderWebHosting", true).

You need the SQL Compact 3.5 SP1 Runtime: microsoft.com/downloads/details.aspx?Fam... Then add a reference to System.Data. SqlServerCe Here is some sample code that creates a new database: using System.Data. SqlServerCe; public static class SqlCompactServices { public static void CreateDatabase() { string connectionString = "Data Source=file.

Sdf"; using (SqlCeEngine engine = new SqlCeEngine(connectionString)) { engine.CreateDatabase(); } using (SqlCeConnection connection = new SqlCeConnection(connectionString)) { connection.Open(); // preform queries just like "regular" SQL Server } } }.

THe point is that you have to call a special method to get it to work. – ctacke Aug 28 '09 at 22:10 Does what he put actually work? It isn't called SQL Server Everywhere any more.

– Bryan Aug 31 '09 at 13:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions