How to determine that rows on server changed and dataset needs to be updated ?

G

Grigol Avetikov

Hi,
I'm starting using ADO.NET and trying to understand if there is any
analog of Server side cursor in ADO.NET.
Using ADO i could just open recordset with serverside cursor and
adOpenDynamic options. Then if another user has changed values on the
server while recordet is opened, i got updated records automatically.
In ADO.NET i couldn't find the way to implement this future.
Is there any event or something else that informs program that records on
the server had been changed ?
Best Regards,
Giga.
 
M

Miha Markic [MVP C#]

Hi Grigol,

No, there isn't. You might use pooling or database specific tool, such as
SqlServer notification services.
 
W

William Ryan eMVP

DBConcurrency exception. Trap it and respond to it. Like Miha said, you
can implement notification services or use messageQueues, but neither
approach is all that simple - they aren't hard, but they take a bit of
familiarity with each. In ADO.NET 2.0 there's a feature to handle it, I've
used it a good bit so far and it's pretty good, but it's a resource hog, not
something you don't want to use everywhere .

I'd just sumbit the changes, and let the concurrency exception tell me
something has changed, from there give the user options to override, cancel
or modify things and then force the update. It's probably the best options.
Or you could just come up with a "Last In always wins" scheme or something
like that"

HTH,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top