views:

69

answers:

4

Using Sql Server 2008, .Net 3.5 & C#.

I am designing a desktop application that runs in a read-only state when there is no internet connection. When the connection is available again it will use webservices to update the central DB.

What technologies could I use to 'download' a set of data applicable to each client for use offline?

+1  A: 

SQL Server Compact Edition was designed for exactly this process. It has features for syncing, but note that it doesn't have full SQL functionality (ie, views, indexing, etc).

C. Ross
Since his data backend is web services, this doesn't seem *too* feasible
JustLoren
If he has good abstraction over his data layer it could still work.
C. Ross
A: 

It depends on what are your requirements, connection type (is it wired/wireless?), is it portable laptop/pocket pc type/desktop pc, there are a few ways to do it, generally, you'd want to monitor your network connection every few minutes (configurable) and when there is activity on the network connection, hook up to the webservice (again, what about firewalling?) and pull down the updates from the database. This monitoring the network can vary, such as pinging to the webservice's ip address every so often (that is a common and easiest way of determining network connectivity) If you are talking about portables such as pda's...it gets even trickier (there is no suitable way to do it within vs's standard controls - you might want to check out opennetcf.org to get the extensions and enhancements for activesync)..Just be careful not to consume too much cpu time as a result of polling when checking on the network connection.

tommieb75
A: 

Isn't this the purpose of a SMART Client application?

Another option would be to cache all of your data in the included ESENT database that is built into windows. Another option would be to include SqlLite or some similar embedded database with your application that syncs when connectivity exists.

Chris Marisic
A: 

You may want to take a look at SQLLite an open source portable database engine.

There is ado.net version on the following url:

http://sqlite.phxsoftware.com/

everthing including the engine is inlcuded in the dll. Very easy to deploy.

I'm just starting to use it for a similar project, and it seems to work really well so far.

It supports a full range of standard sql features such as views, triggers and etc.

Scott

Scott