The Ado.internet Design

ADO.Net is the most current in a series of systems from Microsoft which emphasis on the link of programs to databases of a single form or a different. From the DAO which (and is) was the indigenous manner of link for MSAccess, by the quick-lived RDO, and the now comparatively long-in-the-tooth ADO, this is the future technology of technology. And, though it is not possible that there will not be some foreseeable future incorporate-ons, enhancements, and updates, it seems that this framework of database connectivity is a keeper.

It is not a COM technology, so it can be applied on other platforms in addition to Windows, and agnostic when it arrives to the brand of database it facilitates link to. In addition, it enables additional considerable assistance to the XML paradigm.

The .Net platform will keep on to let you to use the more mature ADO link technology, but, beneath most situation, this is a inadequate decision mainly because of the performance penalty , which arrives from working with the unmanaged code in the COM object.

ADO.Net needs some new approaches of carrying out some of the simple responsibilities of interacting with details. For example, server-aspect cursors and are not supported any additional mainly because of the increased overhead and the possibly large selection of lacks expected on the server. Appropriately, the only link s allowed are ahead only, browse- browse-only final result sets, and disconnected final result sets. There are rumors of server aspect cursors being prepared for foreseeable future releases, likely thanks to the loud grievance from the developer neighborhood. Nevertheless, there are a selection of techniques and resources supplied which drastically lessen the need to have for server aspect cursors, so by the time of the future launch, there may possibly be significantly less need to have for them.

To achieve obtain to the ADO.Net course libraries, you have to incorporate the next statements to the top of your source files:

Imports Process.Info

Imports Process.Info.OleDb* or, if you are connecting to SQLServer

Imports Process.Info.SqlClient

There is also assistance for the ODBC connections by Imports Process.Info.ODBC

These instructions expose the objects essential to link to the details source.

Info Retreival

Like ADO, ADO.Net uses a link object to position to external details. Less than the .Net design, a link is opened, details is retrieved, and then the link is closed. The closing of the link is vital to totally free up sources. The link string (the portion of the remark which identifies the source of the details, as nicely as obtain to it by username and password) is equivalent to the link string grammar beneath the outdated design ADO.

The to start with way to obtain details is after you have described and opened the link, invoke the command object furnishing it with a Decide on statement, or storedprocedure identify with parameters. The Info Reader will let the software to achieve obtain to the returned resultset. An ExecuteReader technique will let a line by line looking through of the details retrieved. Nevertheless, be knowledgeable that this is a ahead only dataset – once a line is browse, unless of course you preserve its contents somewhere, somewhere the details can be shed. The only way to make it out there all over again is to re-create the link and browse it all over again.

The 2nd technique opens a link, retrieves a recordset, then retailers that recordset in an object identified as a DataSet. The DataSet functions and capabilities like a area database, storing the details retrieved – even from multiple resources. It can even url and create interactions amongst multiple tables. At the conclusion of the details retrieval, the link is closed, so that in processing the DataSet is completely disconnected from the details source(s).

The mapping of details amongst the DataSet and the outside the house details resources is taken care of by the DataAdapter object. In addition to holding observe of the connections to the details resources, the DataAdapter also facilitates the updating, deleting, and insertion of details again to the source.

XML

XML is the indigenous structure for ADO.Net. It is so tightly integrated that you can outline and browse schemas, and can seamlessly trade details in the XLM structure, equally looking through and writing with any software on any platform.

Supply: http://www.paladn.com/content articles/ado.dotnet.htm