Update a table when connection is back

John Cassell

Well-known member
Joined
Mar 20, 2007
Messages
65
Programming Experience
Beginner
Hi There,

Could someone tell me if this is possible and, if so, explain how I would go about it pls...

I have a Jobs table stored on a server at our head office. User makes a change to one of the records and changes are saved.

I also need this entire record sending to one of our other servers in another town once it has been updated.

I could get it to do this immediately but if the internet connection was down it would require the user to save the job again when the connection was back up.

I need the record to be stored somewhere so that when the connection is back up, it is then transferred successfully.

Any help would be greatly appreciated.

Thanks

John
 
Erm.. the notion of fofline data encompasses this:

Your client holds a record it downloaded
The net connection dies
The dataset still holds the data
The user edits it
An attempt to save will fail
When the net returns, an attempt to save will succeed


Either: poll with a timer, trying to save and cathcing the exceptions
Or: every time the user tries to save, also check after you save, whether the dataset still HasChanges and save all the other tables/leep reference of which datatables have unsaved changes and save them

You can writeXml() the dataset to disk and load it the next day if the net is down all night
 
Hi Arg/Cjard, thanks for the reply.

The point of this function is that

1a) User saves job
1b) Local database is updated.
2a) Job is put in a queue to transfer to the offsite server.

The user at the local level must not be made aware that the offsite transfer has failed, it just needs to continue attempting until success in the background.

Im going to go down the route of linked servers, haven't done much else but link them and create simple Select statements but am quietly confident I should be able to get them to do what I want.

Its a bit on the back-burner for later now but appreciate the input.

Thanks

John
 
It sounds to me like you need to have a look at the ADO.NET Sync Framework.

It will store your data locally in a SQL Compact database, and then it will synchronise with your main server when you tell it to.

I'm sure it wouldn't be difficult to find out if the sync succeeded or failed, and to retry if necessary...
 
Back
Top