Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

All you Neet To Know About ADO.NET

Added 29 Jul 2008

In this, the final part of her two part series on ADO.NET, Vaijayantee talks about the purpose of ADO.NET, scalability, XML, the ADOCommand and SQLCommand objects and more. If you're just new to .NET then Vaijayantee's ADO.NET tutorial series will have you up and running with databases in a short time.A command object is used for executing a query against the database. ADO command objects are equivalent to DataAdapters that hold the actual query. It needs an established connection, it's command type and commandtext properties to be set before calling its Execute method.

The SQLCommand object is analogous to the command object in ADO. We also need a connection for execution. The DataAdapter supports read, add, update and delete operations and for these it supports following properties:
  • SelectCommand
  • UpdateCommand
  • InsertCommand
  • DeleteCommand
Actually, these properties are objects. To be mores specific, these are instances of the SQLCommand object. Unless otherwise specified, the appropriate objects are generated at runtime automatically. The SelectCommand can be edited at design time while configuring the DataAdapter. The command objects can be executed independently by using their execute methods. Important properties of the object are CommandType and CommandText. If the CommandType property is set to StoredProcedure, then CommandText property should be set to the name of the stored procedure, otherwise the CommandText property contains the actual query.