Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i need a ways to save data while offline, it would just be nice if you give the Idea that how the users in case they are without a network connection and have data they need to enter. And when thay come network connection they can sink offline data to online.

regards

Manoj Sharma
Posted

first you can store this data in session and when you are online at that time you can store in DB.
 
Share this answer
 
Comments
balongi 30-Sep-11 2:32am    
thanks for post.. but the session is server site state management. we cannot store data in session in offline Mode.
http/ASP.net is a connected protocol and environment so if your connection goes down it will not work.

Also because it is run in a "sandboxed" host of a web browser you cannot save data to your clients computer (you can in a limited sense in cookies etc.).

If you need offline storage try looking into html5 instead.
 
Share this answer
 
Comments
balongi 30-Sep-11 2:41am    
thanks :D
Through the web this is almost impossible to do, mostly because you're writing a website that inherently needs to be accessed over the web. Instead of using ASP.Net you should look at writing a Win Forms application. Then, either have two databases or file systems, one running on your server and one set up on the users computer. Then do a similar trick to what most laptops-to-network computers do - each time the user connects, copy across ONLY THE ABSOLUTELY NECESSARY FILES - i.e. only the files that have been updated and only ones that the user is actually going to access, not someone else's documents for example. If you're using database data then simply copy the database across (unless your database grows very big at which point you should consider only copying the necessary bits but that's a stage more advanced than you need initially). While the user logs on, when they save something, copy it to the server. When the user firsts connects is the hard bit really:

Concurrency Issues: - Google It!
There is not space here to fully explain these issues and indeed there is no perfect solution - do what you thinks best or works best in your situation. I advise (as a start) when user first logs on, copy all modified files to the server but only ones that were modified more recently than those on the server.

Hope this helps,

Ed :)
 
Share this answer
 
HTML 5 offers offline storage[^] support.
 
Share this answer
 
Comments
balongi 30-Sep-11 2:40am    
Thanks for post

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900