Home All Groups Group Topic Archive Search About

Updating Client on Database Changes

Author
13 Feb 2006 6:59 PM
Dino Buljubasic
Hi,
How can I update my client imediatelly if database info has changed?

Example 1.
Clinet A (win forms app in C#) has displayed on its form data
retrieved from database (SQL Server).
Client B adds new info or edits existing info of data displayed on
Client A.  How can this change be immediatelly updated on Client A
form?

Example 2.
How to stop  client B from deleting data that is already displayed on
client A win form?

Any help will be appreciated.

_dino_

Author
13 Feb 2006 9:35 PM
W.G. Ryan - MVP
If you're using the 2.0 framework, I think the SqlDependency is what you're
looking for.
Show quote
"Dino Buljubasic" <d***@noplacelikehome.com> wrote in message
news:apl1v1levckg6rqh6gcmq7jbathhjpamc7@4ax.com...
> Hi,
> How can I update my client imediatelly if database info has changed?
>
> Example 1.
> Clinet A (win forms app in C#) has displayed on its form data
> retrieved from database (SQL Server).
> Client B adds new info or edits existing info of data displayed on
> Client A.  How can this change be immediatelly updated on Client A
> form?
>
> Example 2.
> How to stop  client B from deleting data that is already displayed on
> client A win form?
>
> Any help will be appreciated.
>
> _dino_
>
>
Author
13 Feb 2006 9:57 PM
William (Bill) Vaughn
Ah, I doubt it. The overhead involved with the SqlDependency technology
might be to onerous for many general-purpose applications. It can't really
serve as a way to manage concurrency without a thorough understanding of the
mechanism. Consider that when you setup a SqlDependency a trigger is added
to the target table that examines each INSERT, UPDATE and DELETE to see if
the query impacts the selected rows being monitored. This has to be executed
on each action operation and can bring a server to its knees if not
carefully implemented.
In this case I would suggest research on concurrency techniques. These are
not new questions and there are a wealth of workable solutions.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Show quote
"W.G. Ryan - MVP" <WilliamRyan@nospam.gmail.com> wrote in message
news:%23U7zbTOMGHA.740@TK2MSFTNGP12.phx.gbl...
> If you're using the 2.0 framework, I think the SqlDependency is what
> you're looking for.
> "Dino Buljubasic" <d***@noplacelikehome.com> wrote in message
> news:apl1v1levckg6rqh6gcmq7jbathhjpamc7@4ax.com...
>> Hi,
>> How can I update my client imediatelly if database info has changed?
>>
>> Example 1.
>> Clinet A (win forms app in C#) has displayed on its form data
>> retrieved from database (SQL Server).
>> Client B adds new info or edits existing info of data displayed on
>> Client A.  How can this change be immediatelly updated on Client A
>> form?
>>
>> Example 2.
>> How to stop  client B from deleting data that is already displayed on
>> client A win form?
>>
>> Any help will be appreciated.
>>
>> _dino_
>>
>>
>
>
Author
13 Feb 2006 10:51 PM
W.G. Ryan - MVP
Bill:

I agree with everything you said.  I myself have lectured about how it's not
a magic bullet and should have been more careful in explaining the downside
here.  Thanks for doing what I should have ;-)
Show quote
"William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message
news:%233f81hOMGHA.2320@TK2MSFTNGP11.phx.gbl...
> Ah, I doubt it. The overhead involved with the SqlDependency technology
> might be to onerous for many general-purpose applications. It can't really
> serve as a way to manage concurrency without a thorough understanding of
> the mechanism. Consider that when you setup a SqlDependency a trigger is
> added to the target table that examines each INSERT, UPDATE and DELETE to
> see if the query impacts the selected rows being monitored. This has to be
> executed on each action operation and can bring a server to its knees if
> not carefully implemented.
> In this case I would suggest research on concurrency techniques. These are
> not new questions and there are a wealth of workable solutions.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
>
> "W.G. Ryan - MVP" <WilliamRyan@nospam.gmail.com> wrote in message
> news:%23U7zbTOMGHA.740@TK2MSFTNGP12.phx.gbl...
>> If you're using the 2.0 framework, I think the SqlDependency is what
>> you're looking for.
>> "Dino Buljubasic" <d***@noplacelikehome.com> wrote in message
>> news:apl1v1levckg6rqh6gcmq7jbathhjpamc7@4ax.com...
>>> Hi,
>>> How can I update my client imediatelly if database info has changed?
>>>
>>> Example 1.
>>> Clinet A (win forms app in C#) has displayed on its form data
>>> retrieved from database (SQL Server).
>>> Client B adds new info or edits existing info of data displayed on
>>> Client A.  How can this change be immediatelly updated on Client A
>>> form?
>>>
>>> Example 2.
>>> How to stop  client B from deleting data that is already displayed on
>>> client A win form?
>>>
>>> Any help will be appreciated.
>>>
>>> _dino_
>>>
>>>
>>
>>
>
>

AddThis Social Bookmark Button