Can a DataSet tell if tables in the SQL database have been updated?

I've got a client-server app that hooks up to a SQL Server 2000 database. So far everything works well but this application is not the only user of the database. We have an Access front-end that also hooks up to these tables. (The .Net application is replacing another application that goes to the same tables and will eventually also replace the access front-end but that's at least a year off)

My server application has a DataSet that mirrors the SQL tables. This way I have local copy of the table data I can work with programatically (and more quickly) and send updates to the SQL tables as necessary. This arrangement works well but I'm concerned about how to tell if the Access front-end has changed any of the SQL tables since I did the DataSet.Fill.

Is there any way for me to tell through the SQLDataAdapter whether the target SQL database has changed since the last time I've connected to it? I assume that this would have to be SQLServer-driven but I don't know how that would work.

Alternately, I could just do a Fill of the potentially affected tables but that will, hurt my latency.

Any ideas?

[1152 byte] By [DanHeidel] at [2007-12-24]
# 1

you maybe better of locking the records so that only you would be able to have access to them I believe and then modify the records however you like then finally submitting the changes. I can't find a way, or know of a way, where you can check to see if the records have been updated since the last time you called the Fill() method.

im sure someone will give you a more positive answer

ahmedilyas at 2007-10-7 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

HI,

Try looking at Notification Services of SqlServer. I think you can tweak this service to send you messages if a table is changed. Coz I think it works on triggers on SqlServer. I know this service is quite broad but I think you can develop an applicaiton over notification service that can achieve what you want. Contrary to creating your own platform for detecting changes in your database.

http://msdn2.microsoft.com/en-us/library/ms166495.aspx

cheers,

Paul June A. Domag

PaulDomag at 2007-10-7 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3

SqlDependency class also provides a way for your app to be notified when data in the server changes.

http://msdn2.microsoft.com/en-us/library/a52dhwx7.aspx

BillLin-MSFT at 2007-10-7 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified