The ADO.NET Object Model

Questions That Should Be Asked More Frequently

Despite what its name implies, ADO.NET bears little resemblance to ADO. Although ADO.NET has classes that allow you to connect to your database, submit queries, and retrieve the results, the object model as a whole is very different from that of ADO. By now, you've probably picked up on many of those differences. In the coming chapters, we'll take a closer look at the main objects in the ADO.NET hierarchy. But before we do, it's worth addressing some of the questions that developers who are new to ADO.NET are likely to ask.

  1. Q. Why didn't you mention cursors?

  2. A. The initial release of ADO.NET doesn't support server-side cursors. Future releases might include such functionality. Currently, no object in the ADO.NET hierarchy acts as an interface to a server-side cursor. The DataSet and DataTable objects most closely resemble a client-side ADO Recordset object. The DataReader object most closely resembles a server-side ADO Recordset object that uses a forward-only, read-only cursor.

  3. Q. How do I set the current position in a DataTable using ADO.NET? Previous object models exposed methods like MoveFirst, MoveNext, etc. Where are the positional properties and move methods?

  4. A. The DataTable object exposes a Rows collection (of DataRow objects) that you can use to reference any row in the table at any given time; therefore, the DataTable object has no concept of a current row. Because any row can be addressed directly, there is no need for positional properties or navigation methods such as MoveFirst, MoveLast, MoveNext, and MovePrevious.

    These positional properties and move methods were used in ADO most often when displaying data on a form.



Microsoft ADO. NET Core Reference
Microsoft ADO.NET (Core Reference) (PRO-Developer)
ISBN: 0735614237
EAN: 2147483647
Year: 2002
Pages: 104
Authors: David Sceppa

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