Mikecrosoft Posted January 13, 2004 Posted January 13, 2004 Hi all, I'm making my first network shared database (disconnected): I have this question: Is there a way of detects when changed were made in the Database (Table) and update my UI, I mean, Real Time Interfase but still disconnected. I tried using an DataAdapter with events, and I checked the event RowUpdated but it doesn't work as I want. Thanks Mike Quote Mikecrosoft.Net
*Experts* Nerseus Posted January 15, 2004 *Experts* Posted January 15, 2004 No, there's nothing built into .NET that will detect changes to the Database and refresh your client. I'm not sure the type of app you have - maybe this is a requirement. Generally, for data entry apps, you assume data hasn't changed until the user goes to save the data. Since the user's screen might be "stale" (someone else might have updated the same record since the time the user first got it), you'll have to take care of how you handle the second update. You'd also have to have a way to determine if the above actually happened. Generally, you can store a date/time stamp in every record. When you retrieve a record, keep the date/time stamp handy and compare that to the date/time stamp on the record just as you are about to do the update. If they're the same, no one has updated the record since you touched it - otherwise you'll have to handle it. Developing a scheme for the above is hard enough. Trying to have the DB server alert your app when data has changed seems downright nasty. Now, if the DB is a local DB (say, Access running locally), then it becomes a lot easier - relatively :) -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.