OptionsMM
asked on
Extremely urgent datatable refresh
Hi Experts!
I have a server with a SQL server database. This database contains our live trades for the day, updated in real time. The size of the table is very small (like a few hundred rows only).
The client machine has a datatable of these trades which loads fine using dataAdapter.Fill. I want the client datatable to be updated in real time.
If I call the fill again it doens't work, and I cannot clear the table, just make changes to it to make sure they are in-sync.
What is the best way to do this over the LAN? Keep in mind I would like this to work as real-time as posssible, however a small delay could be tolerable.
Should i create a second datatable, have it constantly clear and fill on a timer and run code to update one row at a time? or is there an easier way?
Thanks!!!
I have a server with a SQL server database. This database contains our live trades for the day, updated in real time. The size of the table is very small (like a few hundred rows only).
The client machine has a datatable of these trades which loads fine using dataAdapter.Fill. I want the client datatable to be updated in real time.
If I call the fill again it doens't work, and I cannot clear the table, just make changes to it to make sure they are in-sync.
What is the best way to do this over the LAN? Keep in mind I would like this to work as real-time as posssible, however a small delay could be tolerable.
Should i create a second datatable, have it constantly clear and fill on a timer and run code to update one row at a time? or is there an easier way?
Thanks!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can suggest usage of locks: when a row(record) is being opened for editing it must be locked in the database. When it's being saved the changes are immidiately updated in the database and the lock is removed. When user searches some row by some criterias, there will be access to the database. It this approach, there will be a little bit more accesses to the SQL server, but there will be two main advantages: 1) the data is always synced and up-to-date, 2) there will never be collision between two different client users updating the same record. You said that database volume is not big, so the overhead will be acceptable.
HTH,
Jigit
HTH,
Jigit
Look at this example, it may help you to sort your problem..
http://www.akadia.com/services/dotnet_update_form.html
R.K