Re: Retrieving new information by William
William
Sat Mar 12 12:06:02 CST 2005
It's an age-old problem and a good question. I lectured on this at MSU
and it took an hour or so to discuss--let's see if I can boil it down to a
few paragraphs. Basically, the DBMS (like SQL Server) is a data repository.
An application connects to this data source and retrieves the current state
of the rows stored there. In a disconnected architecture, those rows are
simply copies of the row state at that point in time. The instant you fetch
the rows other users can change the data state and your copy is now out of
date. If you add, change or delete rows and post these changes to the
database, other users will only see these changes (in this architecture)
when they next refetch the rows. The server connection is basically like a
phone call to a librarian. If new books come in, they won't call you to
inform you.
In a server-side cursor architecture, many of these issues are
addressed. In this case, when you execute a SELECT you don't fetch the row,
but a key that addresses a row that's a member of the cursor based on the
WHERE clause. Your application can fetch N rows from the cursor to show to
the user--basically getting a copy of the rows in their current state. As
you navigate through the cursor, the current state is returned from the
database so you see changes (just updates and deletes) made to the database.
You don't see new rows added by other users unless you ask for a dynamic
cursor (which are expensive to build). You do see changes made by other
users as you navigate to a specific row. Server-side cursors are supported
in ADO classic but not in ADO.NET. However, (as I describe in a whitepaper
on my site) you can create a server-side cursor to implement this
architecture.
Another new technology that's available now and being integrated into
Whidbey/Yukon (notification services) permits you to create a data structure
(a DataSet in ADO.NET) and be notified via an event that the data has
changed.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
"Nathan" <nkmacgregor.TakeThisOut@softhome.net> wrote in message
news:ObmLKCwJFHA.3492@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I'm an ADO.NET beginner. I have an application in which all my database
> updates are done on the main form. It includes numerous dialogs which
> access the dataset information, then the dataset is updated when returning
> to the main form. If one user goes to one form and edits new data and
> enters new rows, the database itself is updated accordingly, but that new
> information is not retrieved by other users. How can I fill the dataset
> with new/different information entered by other users without clearing all
> the dataset tables and refilling them?
>
> Thanks,
> Nathan
>