For over a decade now SQL Server and other DBMS developers have been using server-side
cursors to access their databases and scroll through updatable rowsets. This connected approach assumes that the database connection remains in place while the application runs a
query and builds a server-side set of rows that can be retrieved and updated as needed. For a
litany of reasons, Microsoft chose not to implement any server-side cursor functionality in
their new .NET Framework data access interface ADO.NET. This page discusses how you
can work around this limitation to create and manage your own server-side cursors.
Server-side cursors are especially useful when working with highly interactive applications
especially when the application cannot work with disconnected (static) data. This type of
application needs a mechanism to work with a single row or a small set of rows at once.
Server-side cursors are designed to meet this need. As illustrated by the examples in this article, I will show you how to:
Create a cursor based on a focused SELECT statement.
Position a cursor to any designated row.
Change the data in the currently selected cursor row.
Adapt the cursor so other users changes are visible (or not).