Showing posts with label Sync Framework. Show all posts
Showing posts with label Sync Framework. Show all posts

Monday, July 13, 2015

SQL Server Compact ADO.NET data access performance – part 3: SELECTs

In the third instalment in this series, I will demonstrate how to implement SELECTs using the two available APIs in the SQL Server Compact ADO.NET provider. Keep in mind that the “alternative” method of SELECTing requires a corresponding index, so it will on work for simple scenarios where you are looking up on the primary key, for example – luckily, this is quite a common scenario.

I will implement the following interface method, which finds a cacheelement by it’s ID:

CacheElement FindElementByKey(Guid key);

Let’s first look at the implementation of the classic T-SQL SELECT based method:

public CacheElement FindElementByKey(Guid key)
{
    using (var command = _connection.CreateCommand())
    {
        command.Parameters.Add("@key", SqlDbType.UniqueIdentifier).Value = key;
        command.CommandText = @"SELECT [Tag], [Value], [CreatedAt], [ExpirationAt]
            FROM CacheElement
            WHERE [Key] = @key;";
        using (var reader = command.ExecuteReader())
        {
            if (reader.Read())
            {
                var result = new CacheElement();
                result.Key = key;
                result.Tag = reader.GetValue(1) == DBNull.Value ? null : reader.GetString(1);
                result.Value = (byte[])reader[1];
                result.CreatedAt = reader.GetDateTime(2);
                result.ExpirationAt = reader.GetDateTime(3);
                return result;
            }
            else
            {
                return null;
            }
        }
    }
}

This implementation uses a standard T-SQL based parameterized SELECT query. Nothing new here.

Now let us have a closer look at the implementation using TableDirect mode:

public CacheElement FindElementByKey(Guid key)
{
    using (var command = _connection.CreateCommand())
    {
        command.CommandType = CommandType.TableDirect;
        command.CommandText = "CacheElement";
        command.IndexName = "PK_CacheElement";

        using (var reader = command.ExecuteReader())
        {
            reader.Seek(DbSeekOptions.FirstEqual, key);
            if (reader.Read())
            {
                var element = new CacheElement();
                element.Key = key;
                element.Tag = reader.GetValue(1) == DBNull.Value ? null : reader.GetString(1);
                element.Value = (byte[])reader.GetValue(2);
                element.CreatedAt = reader.GetDateTime(3);
                element.ExpirationAt = reader.GetDateTime(4);
                return element;
            }
        }
        return null;
    }
}

Notice the required differences: The CommandType is set to TableDirect, the CommandText is set to the name of the table we want to query, and the IndexName property is set to the name of the index to be used. The Seek command will force a call to read to find the first matching column matching the key value. Notice that the key parameter is an params array, allowing you to use multi-column indexes.

In terms of performance, the classic SELECT appears to be 3 times slower than the TableDirect Seek, but of course your mileage may vary.

You can download the sample code from here.

Thursday, April 10, 2014

An alternative to Merge Replication with SQL Server and SQL Server Compact – Zumero for SQL Server

While looking for a migration path for a customer currently using Merge Replication with SQL Server and Windows Mobile, I came across the recently released solution from Zumero, Zumero for SQL Server. As mentioned in my previous blog post, Merge Replication between SQL Server Compact and SQL Server 2014 is no longer possible, and in addition, SQL Server Compact 3.5 SP2 only supports a limited number of client platforms (Windows Mobile/CE and Windows desktop). Microsoft is promoting Azure Mobile Services with Offline support, but for obvious reasons, this solution does not work for on premise databases.

Zumero for SQL Server enables you to synchronize any mobile device with tables on a central SQL Server, using essentially the same components that we know from Merge Replication:

1: Configuration of tables to be synchronized, and added metadata/tracking to those. Before: Using SQL Server Management Studio to create a Merge Publication with articles (tables)
Now: Using ZSS Manager to create a DBFile with Tables

2: An IIS based agent, that exposes a http(s) endpoint for performing the sync process.
Before: Configure Web Synchronization Wizard
Now: ZSS Server

3: Client library for performing sync.
Before: System.Data.SqlServerCe.SqlCeReplication class, part of the SQL Server Compact ADO.NET provider
Now: Zumero Client SDK and SQLite.

using Zumero;

ZumeroClient.Sync(
"/path/to/sqlite.db", // full path to local db file
null,
"http://MY_ZUMERO_SERVER:8080",
"test", // remote DBFile name
null,
null,
null);



To get started testing out Zumero, simply follow the instructions here: http://zumero.com/get-started/ or start by watching the short, introductory videos here: http://zumero.com/howto/

Notice that Zumero works with any edition of SQL Server 2008 R2 Express or higher/later. Zumero Server is not free, but works with the free SQL Server Express for small scale solutions.

On the client side, the following impressive list client Operating Systems are supported:

Android (native and PhoneGap)
iOS (native and PhoneGap)
Xamarin
Windows, WinRT and Windows Phone 8
Mac OS X
Linux (Ubuntu 12.04+, Fedora 17+)

In my next blog post, I will be doing an interview:  “Hard Talk” with Eric Sink, Zumero founder.

Disclaimer: I am simply a Zumero user, and not affiliated in any way.

Wednesday, May 16, 2012

SQL Server Compact Toolbox 3.0–Visual Guide of new features

After more than 110.000 downloads, version 3.0 of my free, open source SQL Server Compact Toolbox extension for Visual Studio 2010 is now available for download. This blog post is a visual guide to the new features included in this release, many suggested by users of the tool via the CodePlex issue tracker

Extensive support for Sync Framework 2.1

Thanks to a fantastic effort from fellow MVP June Tabadero (blog | twitter), extensive support for Sync Framework 2.1 has been added to the Toolbox, including Provisioning, Deprovisioning, Code Generation, Local Database Cache Code Generation and Explorer tree integration. You can read a nice walkthrough of the features in June’s blog post here. Notice that you will need to install the Sync Framework 2.1 bits for any of these features to work, you can download from here. June also recently blogged about using SQL Server Compact 4.0 with Sync Framework here.

clip_image002

Generate desktop LINQ to SQL classes both for 3.5 and 4.0 databases

I  decided to add the option to generate LINQ to SQL desktop classes, as I recently discovered that you can actually use LINQ to SQL with SQL Server Compact 4.0 (though NOT supported in any way by Microsoft). Read the blog post before you start using LINQ to SQL with 4.0.

clip_image003

clip_image005

Migrate a SQL Server Compact database directly to SQL Server (LocalDB/Express)

As you may know, the Toolbox already has features that allow you to generate a script of a SQL Server Compact database, and run it against a SQL Server database. But this release includes a feature to simplify this process, by not only generating a script, but also immediately executing it against a SQL Server database connected via Server Explorer.

clip_image006

clip_image007

Script only data (with "correct" table ordering)

Due to the increasing number of Database context menu items, I have moved all the script options to a separate “Script Database” sub-menu:

clip_image009

I have also added “Script Database Data”, which scripts only the data (!), sorted correctly by using the QuickGraph topological sorting of a DataSet.

WP DataContext - option to include ConnectionStringBuilder class

I have added the option to also have a ConnectionStringBuilder class generated for Windows Phone, to help constructing valid Windows Phone connection strings, with the limited amount of advanced options available on Windows Phone.

Other improvements

Scripting API fixes:
Tables are now ordered by topological sort when scripting entire database.
Data scripting now uses DbDataReader (or speed and to avoid some OOM issues)
“date” and “datetime2” SQL Server values are converted to “datetime” by default.
SQL scripts with DGML no longer generated.
Server based DGML now includes schema
Duplicate Execution plans fixed.
Improved script execution

Monday, April 23, 2012

Preview of SQL Server Compact Toolbox version 3.0 now available

This short blog post lists the main new features in version 3, with pointers to the menu location of the new features in the upcoming version 3.0 of my SQL Server Compact Toolbox add-in for Visual Studio. Please go ahead and download the preview, and let us know what you think.

New features

Extensive support for Sync Framework 2.1, including Provisioning, Deprovisioning, Code Generation, Local Database Cache Code Generation and Explorer tree integration - thanks to great effort from fellow MVP JuneT (blog | twitter)

image
(Root context menu)

image
(Database context menu)

Generate desktop LINQ to SQL classes both for 3.5 and 4.0 databases (see this blog post for more info)

image
(Database context menu)

Migrate a SQL Server Compact database directly to SQL Server (LocalDB/Express)

image
(Database context menu)

Script only data (with "correct" table ordering, using QuickGraph DataSetGraph with Topological Sort)
image
(Database context menu)

Add own Compact 3.5 based connections when using Visual Studio 11 beta

WP DataContext - option to include a ConnectionStringBuilder class

image

Go and try it out, and let us know what you think!

Sunday, November 7, 2010

Meet me at TechEd Europe in Berlin next week

I am attending TechEd from 8-12 November, and looking forward to learning new things about SQL Server Compact, Sync Framework, Entity Framework, OData, WebMatrix, Visual Studio SP1 etc. (all technologies that are related to SQL Server Compact).

I will be present in the Technical Learning Centre, SQL Server Data Technologies & Developer Tools booth during the event, so feel free to come and have a chat about some of the technologies and tools, that the SQL Server Data Programmability team provides.

See you in Berlin!

Wednesday, September 29, 2010

Sync Framework news roundup

Sync Framework 2.1 is now available.

Notable features include: SQL Azure Synchronization, and support for SQL Server Compact 3.5 SP2 (which includes new APIs for managing change tracking in code).

The Sync Framework Team has also published a code sample, which demonstrates a Sync from SQL Azure to SQL Server Compact.

If you are using Sync Framework, make sure to follow JuneT’s blog. The latest entry concerns Sync Framework Provisioning (creation of metadata to support Sync Framework) and the new Deprovisioning API in Sync Framework 2.1.

To help you prepare a database for Sync, a tool is now available on CodePlex: SyncPrep.

Monday, September 6, 2010

New book: .NET Compact Framework 3.5 Data Driven Applications

A new book has been published this spring, which supplements the other books available on Windows Mobile development with SQL Server Compact. It covers from a very practical and hands-on perspective many facets of Windows Mobile development (now a legacy platform). It attempts to cover use cases for even the more obscure Windows Mobile technologies, like MSMQ, Infrared and Bluetooth, and Pocket Outlook, so it cover a lot of ground.

In terms of data access, there are three chapters devoted to various aspects of this domain:

Building the Data Tier: Describes how to build a data provider independent data layer, and implement this with both SQL Server Compact and Oracle Lite.

Building Search Functionality: Describes how to implement a standard parameterized search function, and also how to implement full text search for SQL Server Compact (a question often asked in the MSDN forums).

Data Synchronization: Describes how to implement Microsoft Sync Services on Windows Mobile, including adding filters and conflict resolution.

Optimizing for Performance: Describes how to optimize for performance using caching and indexes. As the data access layer is based on DataSet, there is no mention of using SqlCeResultSet, Seek and similar APIs for SQL Server Compact.

You can read more about the book here.

Sunday, July 4, 2010

Content overview

My CodePlex SQL Server Compact tools

SQL Server Compact & SQLite Toolbox 4.4 & 4.5 – Visual Guide of new features
SQL Server Compact & SQLite Toolbox 4.3 – Visual Guide of new features
SQL Server Compact & SQLite Toolbox 4.2 – Visual Guide of new features

“SQL Server Compact & SQLite Toolbox” related news


SQLite & SQL Server Compact Toolbox 4.1 – Visual Guide of new features


SQLite Toolbox 4.0 – Visual Guide of Features


SQL Server Compact Toolbox 3.7.3 – Visual Guide of new features


SQL Server Compact Toolbox 3.7.2–Visual Guide of new features


SQL Server Compact Toolbox 3.7.1–Visual Guide of new features


SQL Server Compact Toolbox 3.7–Visual Guide of new features


Document your SQL Server database with free tools: SQL Server Compact Toolbox and DB>Doc
SQL Server Compact Toolbox 3.6–Visual Guide of new features
SQL Server Compact Toolbox 3.4–Visual Guide of new features
SQL Server Compact Toolbox 3.3–Visual Guide of new features
Some SQL Server Compact Toolbox usage graphs
SQL Server Compact Toolbox 3.2–Visual Guide of new features
SQL Server Compact Merge Replication Library alpha released
SQL Server Compact Toolbox 3.1.1 with support for Windows Phone 8 and VS 2012 released
SQL Server Compact Toolbox 3.1–Visual Guide of new features
SQL Server Compact Toolbox 3.0–Visual Guide of new features
SQL Server Compact Toolbox hits 100.000 downloads–new release planned
Migrating databases between SQL Server and SQL Server Compact
SQL Server Compact Toolbox 2.6–Visual Guide of new features
SQL Server Compact Toolbox 2.5–Visual Guide of new features
SQL Server Compact Toolbox available for Visual Studio 11

SQL Server Compact Toolbox 2.4–Visual Guide of new features

SqlCeBulkCopy, a library for fast SQL Server Compact INSERTS released
SQL Server Compact Toolbox 2.3–Visual Guide of new features
SQL Server Compact Toolbox 2.2–Visual Guide of new features
SQL Server Compact ASP.NET Membership, Role and Profile Provider version 2.1 now available
SQL Server Compact Toolbox standalone - including all managed DLLs in a single .exe
New release of Scripting Library and command line utilities–with Schema Diff and DGML from command line
SQL Server Compact Toolbox 2.1–Visual Guide of new features
SQL Server Compact Toolbox 2.0–Visual Guide of new features
New release of ExportSqlCe SSMS add-in and command line utilities–Script to SQL Azure

SQL Server Compact Toolbox add-in now supports version 4.0 databases

SQL Server Compact 4.0 ASP.NET Membership provider

SQL Server Compact version detector

How to Migrate/Downsize a SQL Server database to SQL Server Compact 4.0 (and 3.5)

SQL Server Compact 3.5 Toolbox updated

“SQL Compact Toolbox” – manage merge replication subscriptions

 “SQL Compact Toolbox” Visual Studio 2010 add-in be...

Version 3 of ExportSqlCE now available

SQL Server Compact Bulk Insert Library

Script SQL Server Compact tables in Management Stu...

SqlCeCmd tutorial part two – Creating database obj...

SqlCeCmd tutorial part one – Managing database fil...

SqlCeCmd tutorial part three – query options

Using ExportSQLCE from Visual Studio

Entity Framework Core

Getting started with the SQL Server Compact and other providers for Entity Framework 7 beta 6

Getting and building the Entity Framework 7 alpha bits – step by step

Entity Framework ”reboot” – EF7 – Get a sneak peek via TechEd US live stream

Entity Framework 6

A breaking change in Entity Framework 6.1.2 when using EDMX and SQL Server 2008/2005

Entity Framework 6 and SQL Server Compact 4.0 (10) – “Proper” private desktop deployment
Entity Framework 6 and SQL Server Compact (9) –SqlCeFunctions and DbFunctions
Entity Framework 6 & SQL Server Compact (8) –Logging SQL statements
Entity Framework 6 & SQL Server Compact (7) –New features and fixes in version 6.1
Entity Framework 6 & SQL Server Compact (6)–Entity Framework Reverse POCO Code First Generator
Entity Framework 6 (& SQL Server Compact) (5)–Entity Framework 6 extensions
Entity Framework 6 & SQL Server Compact 4.0 (4) - Restoring full EF Tools support in Visual Studio 2013

Entity Framework 6 & SQL Server Compact (3)–Getting started with the SQL Server Compact 3.5 provider (and Merge Replication)

Entity Framework 6 & SQL Server Compact 4 (2)–Easy Private Desktop Deployment

Entity Framework 6 & SQL Server Compact 4 (1)–Workflows and tooling

INSERTing many rows with Entity Framework 6 beta 1 and SQL Server Compact

Fix for Entity Framework poor INSERT performance with SQL Server Compact and server generated keys

Fixing the Entity Framework designer “Generate Database from Model” T4 template

Entity Framework 4.x

Viewing SQL statements created by Entity Framework with SQL Server Compact

Saving images to SQL Server Compact with Entity Framework 4.1 Code First

Using SQL Server Compact 4.0 with WPF DataGrid, Entity Framework 4 and Private deployment (part 1)

Using SQL Server Compact 4.0 with Desktop Private Deployment and a Setup project (MSI) (part 2)

Entity Framework with SQL Server Compact 4.0 and ASP.NET – Dynamic Data, OData, deployment (part two)

Using Entity Framework with SQL Server Compact 4.0 CTP and ASP.NET – tips & tricks (part one)

Solutions to: “Server-generated keys and server-ge...

SQL Compact and Entity Framework woes

Deployment

The trouble with Any CPU–Prefer 32 bit–BadImageFormatException

SQL Server Compact 4 desktop app with simple Private Deployment and LINQ to SQL

Private deployment of SQL Server Compact 3.5 SP2

SQL Server Compact Private Deployment tweaks

SQL Server Compact “Private Deployment” on desktop–an overview

How to detect if the x64 SQL Compact 3.5 SP2 deskt...

Requirements for SQL Compact installations on x64 ...

Running SQL Compact from CD-ROM (read only media) ...

x64 and SQL Compact

Sort order issue when moving sdf files between pla...

SQL Compact internals and T-SQL

SQL Server Compact ADO.NET data access performance – part 1: Overview

SQL Server Compact ADO.NET data access performance – part 2: INSERTs

SQL Server Compact ADO.NET data access performance – part 3: SELECTs

SQL Server Compact 4.0 SP1 hotfix available

SQL Server Compact breaks when upgrading from Windows 8 to Windows 8.1

FAQ: Why is opening my SQL Server Compact database slow?

Scripting image column data for INSERT statements

Useful new topics in SQL Server Compact 4.0 Books Online

Comparison of SQL Server Compact 4, 3.5 SP2 and SQL Server Express 2008 R2

SQL Server Compact 3.5 SP2 downloadable update list

SQL Compact Table Copy/Export samples published

What’s new in SQL Server Compact 3.5 SP2 beta

Dealing with very large SQL Compact database files...

SQL Server 2005 Compact Edition downloadable hotfixes...

SQL Compact 3.5 SP1 downloadable hotfix list

Scripting SQL datetime fields and avoiding localiz...

SQL Compact 3.5 knowledge base articles

Working with Case Sensitive SQL Compact databases

Testing an sdf file for version info

TOP clause now supported

Hidden gem: Rename table

Code snippet of the week

SQL Server Compact Code Snippet of the Week #1 : locate the ROWGUIDCOL column in a table

SQL Server Compact Code Snippet of the Week #2 : locate the IDENTITY column in a table

SQL Server Compact Code Snippet of the Week #3 : locate the rowversion column in a table

SQL Server Compact Code Snippet of the Week #4 : select rows 50 to 60 from a table

SQL Server Compact Code Snippet of the Week #5 : rename a table

SQL Server Compact Code Snippet of the Week #6 : list all user tables in a database

SQL Server Compact Code Snippet of the Week #7 : get the full path to a database file

SQL Server Compact Code Snippet of the Week #8 : script a database to SQLite

SQL Server Compact Code Snippet of the Week #9 : migrate a SQL Compact database to SQL Server

SQL Server Compact Code Snippet of the Week #10 : generate a CREATE TABLE script

SQL Server Compact Code Snippet of the Week #11 : detect if SQL Server Compact is available

SQL Server Compact Code Snippet of the Week #12 : get the SQL Server Compact runtime version

SQL Server Compact Code Snippet of the Week #13 : reseed (reset) an IDENTITY column

SQL Server Compact Code Snippet of the Week #14 : script all data in a table

SQL Server Compact Code Snippet of the Week #15 : flush data to disk immediately 

SQL Server Compact Code Snippet of the Week #16 : detect Entity Framework database type

SQL Server Compact Code Snippet of the Week #17 : using wildcards with a parameterized query

SQL Server Compact Code Snippet of the Week #18 : handling SqlCeExceptions

SQL Server Compact Code Snippet #19 : migrate a SQL Server database to SQL Compact

SQL Server Compact Code Snippet #20 : change database password

Using SQL Server Compact

Visual Studio

Visual Studio 11 beta - Tooling for SQL Server Compact

Analyzing SQL Server Compact queries using Visual Studio 2010 Premium/Ultimate

SQL Server Compact Toolbox standalone - including all managed DLLs in a single .exe

Visual Studio 2010 Service Pack 1 with support for SQL Server Compact 4.0 released

Migrate a SQL Server Compact database to SQL Server using Web Deploy (MSdeploy)

Using SQL Server Compact 4.0 with WPF DataGrid, Entity Framework 4 and Private deployment (part 1)

Using SQL Server Compact 4.0 with Desktop Private Deployment and a Setup project (MSI) (part 2)

Visual Studio Tools for SQL Server Compact 4 now available

Using Entity Framework with SQL Server Compact 4.0 CTP and ASP.NET – tips & tricks (part one)

SQL Compact 4.0 now available as a .zip file

HOW TO: Detect SQL Server Compact version information

HOW TO: Upgrade a version 3.x database file to SQL Server Compact 4.0

How to check the Visual Studio 2010 edition from code

FAQ: Why does my changes not get saved, SQL CE doe...

Diagram database table relationships using DGML, S...

Using the ADO.NET Data Connection dialog in your o...

How to save and retrieve Images using LINQ to SQL ...

Using SQL Compact with Log4net

Two great tutorials

Crystal Reports with SQL Compact

Accessing SQL Compact from SQL Server "Linked Serv...

x64 and SQL Compact

SQL Compact 3.5 - Manage relationships

Windows Phone

Useful Windows Phone advice from Nick Randolph

Windows Phone / SQL Server Compact resources

Populating a Windows Phone “Mango” SQL Server Compact database on desktop

SQL Server Compact Toolbox 2.2–Visual Guide of new features

Windows Phone Local Database tip: Viewing the SQL generated by LINQ to SQL

Windows Phone Local Database tip: Batch INSERT performance

Windows Phone Local Database tip: Exploring INSERT performance–5 power tweaks

Generating a LINQ to SQL DataContext for VS Express for Windows Phone

Windows Phone Local Database tip: Initializing the database

SQL Server Compact Toolbox 2.6.1–Visual Guide of new features

Windows Phone Local Database tip: Exploring multiple UPDATEs and rowversion impact

Windows Phone Local Database tip: Working with encrypted database files

Windows Phone Local Database tip: Exploring DELETE performance and a “Bug Alert”

Generate a Windows Phone 8 Local Database DataContext from an existing database

Windows Mobile

SQL Compact 3.5 OLEDB C++ sample now available

SQL Compact versions on Windows Mobile

New SQL Server Compact training video

ADO.NET Sync Services for Devices sample

SQL Compact version on Windows Mobile 6.5

Mobile Application Pocket Guide v1.1

Intro to Mobile Sync

Windows Mobile platform support

Mobile sample using SQL Compact

SQL Compact Device Deployment

ASP.NET

SQL Server Compact 4.0 under ASP.NET Hosting– common issues

Using Entity Framework with SQL Server Compact 4.0 CTP and ASP.NET – tips & tricks (part one)

Entity Framework with SQL Server Compact 4.0 and ASP.NET – Dynamic Data, OData, deployment (part two)

Getting started with SQL Server Compact 4.0 (no WebMatrix)

ASP Classic

Access SQL Server Compact 4 with ASP Classic and VbScript

VBA (Office)

Tips and tricks for using SQL Server Compact with VB/VBA/VBScript/ASP

Inserting images from VBA

Import SQL Compact data to Excel

OData (WCF Data Services)

WCF Data Services with Windows Phone - bandwidth requirements measured

Entity Framework with SQL Server Compact 4.0 and ASP.NET – Dynamic Data, OData, deployment (part two)

Walkthrough: Expose SQL Compact data to the world ...

Silverlight

Access a local SQL Compact database from Silverlig...

WPF

Using SQL Server Compact 4.0 with WPF DataGrid, Entity Framework 4 and Private deployment (part 1)

Using SQL Server Compact 4.0 with Desktop Private Deployment and a Setup project (MSI) (part 2)

Binding SQL Compact data to WPF in less than 100 l...

LINQ to SQL

Using LINQ to SQL with SQL Server Compact 4.0 (yes, you can!)

How to save and retrieve Images using LINQ to SQL ...

SQL Compact and LINQ to SQL performance advise

LINQ to SQL

 

SQL Server Management Studio

How to clear the list of recently opened SQL Serve...

SQL Server 2008 Management Studio Express

Accessing SQL Compact from SQL Server "Linked Serv...

SQL Compact 3.5 - Manage relationships

PowerShell

Using PowerShell to manage SQL Server Compact database files

F#

HOW TO: Connect to SQL Server Compact from F#

CodeSmith

Getting started with a CodeSmith nettiers data acc...

Merge Replication

Shop Talk” with Eric Sink, Zumero for SQL Server founderShop Talk” with Eric Sink, Zumero for SQL Server founder
An alternative to Merge Replication with SQL Server and SQL Server Compact – Zumero for SQL Server
Merge Replication with SQL Server Compact 3.5 SP2 and SQL Server 2014 and 2012

SQL Server Compact 3.5 SP2 now supports Merge Replication with SQL Server 2012

Snapshot Synchronization with SQL Server Compact 4.0

Walkthrough: Configuring the Merge Replication Age...

Recent Synchronization and Replication advice from...

IIS 7.5 (Windows Server 2008 R2) and SQL Compact i...

Is RDA (Remote Data Access) still relevant

SQL Compact Merge Replication “bible” updated

Merge replication performance tips

Merge Replication and ISA Server

Intro to Mobile Sync

SQL Compact 3.5 client agent logging

Versions...versions

Sync Framework

Sync Framework news roundup

Recent Synchronization and Replication advice from...

2 new Sync Services hotfixes for SQL Compact

Sync SQL Compact with SQL Azure and Oracle

Microsoft Sync Framework 2.0 released to web!

ADO.NET Sync Services for Devices sample

New features in Sync Framework

Recent Sync Framework articles

SQLite

“Database First” with SQLite in a Universal App using the SQLite Toolbox and sqlite-net

Getting started with SQLite in Windows Store / WinRT apps

Exporting SQL Server Compact to SQLite

Other news stories

Using Exceptionless.com for error logging and feature usage tracking with a Visual Studio add-inUsing Exceptionless.com for error logging and feature usage tracking with a Visual Studio add-in

SQL Server Data Tools for Visual Studio – versions, downloads and compatibility

SQL Server - using newsequentialid() as a function, similar to newid()

Primeworks, supplier of tools for SQL Server Compact, is closing, making all products free, open source

Integrating Red Gate SmartAssembly in the SQL Server Compact Toolbox

SQL Server Compact 4.0 SP1 Released To Web

The state and (near) future of SQL Server Compact

SQL Server Compact 4.0 SP1 CTP1 available

SQL Server Compact will be available for developers in upcoming Windows Phone “Mango” update

SQL Server Compact 4.0 released!

SQL Server Compact 4.0 CTP2 released

SQL Server Compact 4.0 news roundup

SQL Compact 4.0 CTP1 released

SQL Server Compact 3.5 SP2 released!

What’s new in SQL Server Compact 3.5 SP2 beta

No SQL Compact on Windows Phone 7?

New KB article about how to remove SQL Compact 3.5...

Interview with SQL Server Compact Program Manager ...

Dynamics Mobile – SQL Compact used in MS Dynamics ...

News from blog land

3rd party tools

SQL Compact 3rd party tools

Books

New book: .NET Compact Framework 3.5 Data Driven Applications

SQL Server Compact Edition books

SQL Compact Merge Replication “bible” updated

Mobile Application Pocket Guide v1.1

Architecture Journal 14

Sunday, May 9, 2010

Recent Synchronization and Replication advice from Microsoft bloggers

This is a round-up of some recent blog entries from Microsoft relating to Sync and Replication.

Merge Replication

The Microsoft SQL Server Replication Support Team has started a blog which includes excellent Merge Replication advice. Start at this overview blog entry.

In addition, Rob Tiffany has made a list of SQL Compact Merge Replication performance tips available here. This list is a summary of some of the advice in Robs excellent Merge Replication book. It even includes some of the improvements in SQL Compact 3.5 SP2, including the new PostSyncCleanup property of the SqlCeReplication object, and highlights the new support for Windows 2008 R2 with IIS 7.5 included with the SP2 server tools.

Sync Services

The Sync Services team has published a useful FAQ. And the SQL Support team blog has a long walkthrough of setting up N-tier Sync Services for ADO.NET.

Thursday, March 11, 2010

2 new Sync Services hotfixes for SQL Compact

Sync Services for ADO.NET for Devices 1.0 has been updated for performance. The initial release of this used DataSet on the device for INSERTs and UPDATEs, which caused large memory consumption and slow performance on the device. The updates uses SqlCeResult set instead of DataSet, preventing double-buffering of data (causing excessive memory consumption), and improved INSERT and UPDATE performance. When you synchronize data to a SQL Server Compact 3.5 database by using Sync Services for ADO.NET for Devices, the synchronization may be slow http://support.microsoft.com/kb/973058

The following SQL Compact hotfix addresses an issue that is commonly encountered when syncing tables with foreign key constraints:
FIX: Error message when an application inserts a value into a foreign key column in SQL Server Compact 3.5: "No key matching the described characteristics could be found within the current range" http://support.microsoft.com/kb/974068

Tuesday, January 12, 2010

Sync SQL Compact with SQL Azure and Oracle

There have been a number of new releases from the Sync Framework team to assist is developing off-line applications using Sync Framework and SQL Compact:

Microsoft Sync Framework Power Pack for SQL Azure November CTP (32-bit)

That’s a long name – what it covers in relateion to SQL Compact is the following:

SqlAzureSyncProvider – Sync Framework 2.0 provider that support SQL Azure

Sql Azure Offline Visual Studio plug-in – allows you to take a SQL Azure database offline – similar to Local Data Cache already in Visual Studio.

You can download the tool from here. Please note that Sync Framework 2.0 is also required.

The Sync Framework team has blogged about the tool here, and in addition, Mahjayar from the team has blogged about going the other way sync direction wise  (from SQL Compact to Azure)

Database Sync – SQL Compact and Oracle (!!)

A sample demonstrating how to synchronize data between SQL Compact and an Oracle database has been released. The times they are a-changing!

Wednesday, October 28, 2009

Join me for lunch!

I will be hosting a Birds-of-a-Feather Lunch at the PASS  Summit, Seattle, on Tuesday, November 3, 2009 at 11:30am-1:30pm.

My subject of course will be “SQL Server Compact - The little database that could”, where I will be present to discuss the small and big features of SQL Server Compact, and note any ideas, issues and feedback you have for the product. I addition, I would like to hear any wishes that you may have for the next version of SQL Compact for Tools and Programmability. I will gather your ideas and feedback and pass them on to the product team.

See you there!

Monday, October 19, 2009

Microsoft Sync Framework 2.0 released to web!

The Microsoft Sync Framework 2.0 SDK is now available for download.

The major new features in Database Providers include (my highlights in bold)

  • New Database Providers (SQL Server and SQL Server Compact): Enable hub-and-spoke and peer-to-peer synchronization for SQL Server, SQL Server Express, and SQL Server Compact. Sync Framework automatically creates all of the commands that are required to communicate with each database. You do not have to write synchronization queries as you do with other providers. The providers support: flexible initialization options; batching of changes based on data size; and maintenance tasks, such as metadata cleanup and server database restore.
  • Robust Memory-Based Batching: Previous versions of Sync Framework and Sync Services for ADO.NET provided a way for developers to define their own batching logic but there were a lot of limitations, including significant complexity, excessive chattiness, out of memory issues, and restrictions on usage. Sync Framework 2.0 addresses all of these issues by providing a more complete and robust batching API. Developers no longer have to write batching logic themselves because Sync Framework divides changes into batches based on several properties in the API. Batches are now defined by memory consumption rather than the number of rows synchronized, which has eliminated out-of-memory issues for most common scenarios.
  • Provisioning and Management APIs: Provisioning and initialization activities that were previously exposed only through Visual Studio tooling have now been added to the database provider APIs. This includes the ability to provision an existing database by adding the change-tracking tables and triggers that are required by Sync Framework. It also includes the ability to start with an empty database, create the user schema, and provision that schema based on another server or client database that has already been provisioned.
  • Performance Improvements: The new database providers in this release have been thoroughly tested in large-scale scenarios in which a single server supports thousands of clients with hundreds of concurrent synchronization operations. This testing resulted in a large number of internal performance improvements that enable Sync Framework database providers to perform as well as other Microsoft technologies like Remote Data Access (RDA) while offering a wide range of capabilities that compete with end-to-end solutions like merge replication.

The on-line documentation has not been updated yet.

Wednesday, July 8, 2009

ADO.NET Sync Services for Devices sample

A new sample has been made available at CodePlex, SyncComm. This sample/reusable framework demonstrates how to make WCF communication work the best possible way when using Compact Framework. It implements the following features: Correct WCF service configuration, use of zip compression for data transfer and batching of updates. All in order to improve performance and ease developer pain. Good stuff – while we are waiting for version 2 (and later)!

Thursday, June 4, 2009

New features in Sync Framework

A 90 minute webcast detailing the new features in the next version of the Microsoft Sync Framework (version 2) is now available for offline viewing and PPT download. The new version with the features presented here will RTM in 2nd half of 2009 (and a CTP will come very soon – June (?)).

Notable new features (relating to SQL Compact) include:

P2P Sync with SQL Compact 23:00– both on desktop and devices – provides ability to Sync 2 SQL Compact databases with each other! Can’t wait to try that out!

Snapshot Initialization 39:40 pre generate the SQL Compact file on the server and then download to the client, and only incremental changes need to be downloaded afterwards. Limits time to get initial data down, and decrease server load. Initially all data is downloaded to the web service in a “source” SQL Compact file, and based on this a special snapshot SQL Compact file is created. The client know that this is a snapshot, and will only download incremental changes after getting the snapshot.

Opt out of ADO.NET DataSets – mapping to a developer defined payload. (Not in version 2)

Using SqlCeResultSet for client side inserts – to improve performance.

UPDATE: CTP2 is now available for download.

Saturday, April 11, 2009

Recent Sync Framework articles

Links to a few recent Sync Framework articles:

My First Microsoft Sync Framework Application

A tutorial on getting started with the ADO.NET Sync Services Framework

Manage Your Data Effectively With The Microsoft Sync Framework

MSDN Magazne article, that gives an overview of the Sync Framework, and gives some code samples for ADO.NET Sync Services implementation

Walkthrough: Extending the Local Database Cache to Support Bidirectional Synchronization

Important documentation update, describing the steps required to enable 2-way sync (a common requirement in real life)

Tuesday, October 21, 2008

Going to PDC

I am attending PDC in Los Angeles. There are a few sessions relating to SQL Compact, that I will consider attending:

SQL Server Compact: Embedding in Desktop and Device Applications
Wed 10/29 | 3:00 PM-4:15 PM | 402A
Presenter: Steve Lasker

Learn how SQL Server Compact can be used to create data files for your applications, run applications directly from DVD, capture user activity, and sync "back home." Learn the different deployment options, including the newly released 64-bit support and best practices for performance.

Offline-Enabled Data Services and Desktop Applications
Wed 10/29 | 3:00 PM-4:15 PM | 408A
Presenter: Pablo Castro

The ADO.NET Data Services Framework (a.k.a. Project "Astoria") introduced a way of creating and consuming flexible, data-centric REST services. By combining data services with the Microsoft Sync Framework, learn how to create offline-capable applications that have a local replica of their data, how to synchronize that replica with an online data service when a network connection becomes available, and how replicas can be used with the ADO.NET Entity Framework. Also, hear us talk about our plans, see the tools that help client- and server-side setup, and discuss the runtime components and APIs.

Microsoft Sync Framework Advances
Mon 10/27 | 1:45 PM-3:00 PM | 515B
Presenter: Lev Novik

This session shows you how the next version of the Microsoft Sync Framework makes it easier to synchronize distributed copies of data across desktops, devices, services, or anywhere else they may be stored.

Sync Framework: Enterprise Data in the Cloud and on Devices
Tue 10/28 | 5:15 PM-6:30 PM | 408A
Presenter: Liam Cavanagh

See how synchronization plays a pivotal role in transitioning to a managed cloud environment by creating a central hub of information in the cloud. Using synchronization, organizations can enable more efficient mobile and enterprise-to-enterprise scenarios.

Hope to see you there!

Blog Bling 1