Questions That Should Be Asked More Frequently

[Previous] [Next]

Q. What type of cursor should I use?

A. Whatever is appropriate in your application.

In most cases, what's appropriate is what will perform well with large numbers of simultaneous users. The simplest advice I provide to customers is to use client-side cursors because of the functionality they provide and because they don't put undue stress on the database system.

Q. Why shouldn't I use the dynamic cursors? They seem to provide the most functionality, and I like functionality.

A. You pay for the functionality you get.

With forward-only cursors, you're asking the database system to provide minimal functionality. If you want to scroll back and forth through your data, you need to store it on your own or in the ADO Cursor Engine. The more functionality you ask your database server to provide in the cursor, the more work it needs to perform. Remember that every time ADO asks for more data to fill its cache, the query processor reexamines the tables referenced by the query, determines which records satisfy the query criteria, and then generates the requested records in the cursor. Sure, a dynamic cursor provides more functionality, but there's a heavy price to pay for that functionality.



Programming ADO
Programming MicrosoftВ® ADO.NET 2.0 Core Reference
ISBN: B002ECEFQM
EAN: N/A
Year: 2000
Pages: 131
Authors: David Sceppa

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net