SQL Mobile rocks!

After having attended some pretty impressive presentations on CF 2.0 and SQL Mobile (SQL Server 2005 Mobile Edition, i.e. :-), the successor of SQLCE 2.0, at TechEd Europe, I am playing with the VS2005 Beta 1 and a pre-Beta 2 build of SQL2005. What can I say - I'm blown away by what these teams are building!

Creating a publication and setting up replication for SQL Mobile in the SQL Workbench is a snap, couldn't be easier. Then configure a virtual directory on the IIS for the replication, and create a SQL Mobile (.SDF, as before) database from that publication, just using the wizard, without writing a single line of code or awkward configuring of this and that. And the best is, the wizard even spits out the C# or VB.NET code that can be later used in a CF app to do the synchronization! Looks like this:

SqlCeReplication repl = new SqlCeReplication();
repl.InternetUrl = @"https://xpfrankpr1/northwind/sqlcesa30.dll";
repl.InternetLogin = @"frankpr";
repl.InternetPassword = <...>;
repl.Publisher = @"XPFRANKPR1";
repl.PublisherDatabase = @"Northwind";
repl.PublisherSecurityMode = SecurityType.DBAuthentication;
repl.PublisherLogin = @"sa";
repl.PublisherPassword = <...>;
repl.Publication = @"Northwind";
repl.Subscriber = @"northwind";
repl.SubscriberConnectionString = @"Data Source='C:\nw.sdf';Password='';Max Database Size='128';Default Lock Escalation ='100';";

repl.AddSubscription(AddOption.CreateDatabase);
repl.Synchronize();

The above code uses publication/replication to create a new SQL Mobile database on your device and sync it with the server.

In the VS2005 IDE, you can connect to any existing SDF on your machine or device, and manage that DB there. You can also create a datasource based on that connection, and directly drag and drop tables from that datasource (i.e., the underlying SDF) onto your form (lets you choose between datagrid or data entry form with various textboxes - similar to the Dataform Wizard on the desktop). You can even configure master-detail relations if your data source contains multiple tables.

Compared to this, CF 1.0 and SQLCE 2.0 look like stone-age technology... :-)