views:

51

answers:

2

What solution/s are recommended for working disconnected?

I have a web application (asp.net) 3.5. Part of the application consists of visiting clients at home and completing a questionaire.

My question is, how should I collect this data if no connection to the internet. I presume store as xml document, what do I use for the UI application

Thanks

UPDATE: I found this: http://msdn.microsoft.com/en-us/library/ms839386.aspx

Any other links for alternative design?

+1  A: 

Is this data to be collected on a laptop or mobile hand held device.

Create a windows, mobile or web based UI that saves data into a dataset/datatable . Use datasets/datatables WriteXML() function to put the data into an xml file

More info: http://msdn.microsoft.com/en-us/library/system.data.datatable.writexml.aspx

Create a function in the UI (a button press) that loads the xml file (user can probably choose this file or upload it) into the dataset and then syncs the dataset to your database (i.e. when they are at a place where they can connect to the database)

OR

Have internet on the device that you are using to visit clients, make your database available on the public domain, and directly save data into it using a web/windows or mobile application.

soldieraman
+2  A: 

If you will be doing non-trivial manipulation of this data then you could consider using SQL Server Compact. It's a local database that's embedded in your application. You interact with it the same way as regular SQL server, and it supports transactions, referential integrity constraints etc.

Synchronising your data would then be a matter of reading your local database and inserting records into your master database.

The XML option is simpler, but you should consider crashes during save or multiple threads accessing the XML at once before you commit to store your application's data in a flat file. If that isn't a problem, soldierman's WriteXML() solution is quite neat.

Whichever storage option you choose, I would recommend assigning each record a GUID when it's created. That way when you are synchronising with your master database you don't run the risk of inserting the same record twice.

ctford