Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a small query. For example there are two users who are running a application. When user1 inserts a record into a table can we update the dataset of user2 automatically or alert the user2 to refresh his dataset.
Posted

I don't think there's a way, especially if working in disconnected mode. :p

 

However, when issuing an update command with a DataAdapter you have various ways to detect if items don't match up.. One way is you can set the ContinueUpdateOnError property to true, when after doing an Update() you can check to see if your DataSet HasChanges property is set to true. If it is you can then copy the un-updated rows to a new table, loop through them to determine why they weren't updated, then display the appropriate errors to the user.

 

The key to this is really knowing how the CommandBuilder works so you can customize it appropriately. A tip for multi-user databases is to have a timestamp column so you can easily determined when the row was last updated. Using the CommandBuilder you'd simply do an insert WHERE id=? AND lastupdate=? using the original row values (again read up on the CommandBuilder).

 

I know that doesn't answer your question... but until one of the forum gurus answers it may be a decent alternative to what you're looking for.

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...