1

I have a desktop application (C# .NET 3.5) that uses a SQL server for it's database. I have had a request from the client, however, to make it possible to export the database as it stands, and be able to use it on a laptop without connectivity. They understand that updates to the parent server will not be reflected in these offline clients.

Is there a way I can just save the DataSet's to a binary form and write them to a disk and send those files to the offline clients.

2
  • Is the offline instance SQL Server as well? Assuming the database is less than 4 GB in size, a backup & restore would work..but then you have to recreate logins and any jobs. Commented Mar 26, 2010 at 22:08
  • No it's not, I'd really just like to export the DataSet object into binary, and be able to save it out to a file. Commented Mar 26, 2010 at 22:38

3 Answers 3

6

There is an entire line of tools and technologies covering this case, namely the Synch Framework. See Synchronizing Databases. See Getting Started: Client and Server Synchronization for a starting example involving a SQL Server Compact Edition file on the client (.SDF file) that is synchronized with a SQL Server central database. Note that the client won't install anything else other than you application, the SQL Server CE is just a few in-process DLLs that you distribute with your app, nothing nearly as complex as a SQL Express edition on the client.

The good news is that Synch Framework no only allows the client to get their own on-the-go snapshot of the database, it actually allows for changes applied while disconnected to be merged back into the central site.

Sign up to request clarification or add additional context in comments.

Comments

4

You could either use Compact Edition (aka. SDF files), or you can save the datasets as XML using the built-in method.

1 Comment

I like the XML exportation. I think I'll do this.
3

Can't you just take a SQL Server level backup and have them install e.g. SQL Server Express on their laptops and restore the database there?

That way you wouldn't have to do anything special in your app at all - just change the connection string to point to the local SQL Server Express instance, and off you go! No mucking around with serialized data sets and stuff......

3 Comments

I don't want them to have to install any additional software. Yes, SQL server express is an option. However, the target audience is not technically savvy, and I don't want 20,000 SQL Server Express instances showing up in network browsers across their org.
plus you could configure "on demand" merge replication to syncronize the two if it was ever needed (although rowguid columns like to be a pain with some data access code).
This is not a syncro situation. I wouldn't want the syncro'ed. Basically I have a central server, that is what's used 90% of the time. Some times, however, I have a workstation that won't have connectivity, so I wanted a way that I can simply have one person "Export" the data, and hand it to the operator of the non-connected system.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.