tags:

views:

66

answers:

2

Hi there I get alot of help from this website.Thank Long live stack overflow team and contributors.

My question is that is Lets say I have a c# desktop app running in client machine on network say at office and that particular application stores data in mdf database file.

Backup of that database is placed on Server on that network as mdf file .

Is it possible that client application while running frequently checks that database on server is same as on clients end and if not newer replaces older. If it is possible then how or there is any alternate way?

A: 

Along with the above comment, not sure what this has to do with SVN, but you can check the timestamp of the networked DB file at startup, then keep polling it and if it changes then copy the file to the local location and reset your timestamp.

EDIT-- With more thought, you could use an SVN implementation to handle this, you could check out SharpSVN - http://sharpsvn.open.collab.net/ (from their website) SharpSvn is a binding of the Subversion Client API for .Net 2.0 applications. It is xcopy deployable but you would need to install the VC2008 C++ runtime.

pstrjds
Well i really donot have idea about time stamp.How can we do this and is this reliable if there is multiple clients
Afnan
Just to clarify, you want the data on your client to be overwritten by the data on the server if it is "out of date". You can use the FileSystemInfo class and check the LastWriteTime for the the file on the server, then check the LastWriteTime with your data on the client and if the client is older then you can overwrite it. I am guessing that is what you mean by replace. Since the overwrite is going on on the client it shouldn't matter if there are multiple clients (unless they are sharing a machine via terminal services or multiple clients open by the same user)
pstrjds
+1  A: 

It seems you are looking for Sync Framework Database Synchronization:

http://msdn.microsoft.com/en-us/sync/bb887608.aspx

Jakub Konecki
well I want that if client machine gets its application corrupt then on install fresh application pervious data from server is taken.
Afnan
and why not keep server primary target for database place?answer is there might not be regular connection there may be diss connection so cient should work standalone
Afnan
That's what Sync Framework is for - to synchronize databases on machines which are not always connected (ie. smart client type applications)
Jakub Konecki
Will it support multiple clients and what if we adopt a methodology that check which table is modified in database and update that same table in database present at server
Afnan
and in my case there is no internet involved Server is network based LAN(on domain)
Afnan