Components of data providers in ADO.NET

Components of data providers in ADO.NET.

The Connection Object
The Connection object represents the connection to the database. The Connection object has ConnectionString property that contains all the information, required to connect to the database.

The Command Object
The command object is used to execute stored procedures and command on the database.
It contains methods to execute command on the database such as ExecuteNonQuery, ExecuteScalar and ExecuteReader.

ExecuteNonQuery
Executes commands that return no records, such as INSERT, UPDATE, or DELETE
ExecuteScalar
Returns a single value from a database query
ExecuteReader
Returns a result set by way of a DataReader object

The DataReader Object
The DataReader object provides a connected, forward-only and read-only recordset from a database. The Command.ExecuteReader method creates and returns a DataReader object. Since it is connected to the database throughout its lifetime, it requires exclusive use of connection object.

The DataAdapter Object
The DataAdapter object acts a communication bridge between the database and a dataset. It fills the dataset with data from the database. The dataset stores the data in the memory and it allows changes. The DataAdapter's update method can transmit the changes to the database.

The DataAdapter Object's properties :

SelectCommand
Contains the command text or object that selects the data from the database.

InsertCommand
Contains the command text or object that inserts a row into a table.

DeleteCommand
Contains the command text or object that deletes a row from a table.

UpdateCommand
Contains the command text or object that updates the values of a database.
Connected and disconnected data access in ADO.NET
ADO.NET - Connected and disconnected data access in ADO.NET - This object requires exclusive use of the connection object. It can provide fast and forward-only data access. It doesn't allow editing....
CommandType property of a SQLCommand in ADO.NET
ADO.NET - CommandType property of a SQLCommand in ADO.NET - A SQLCommand has CommandType property which can take Text, Storedprocedure or TableObject as value.
Dataview component of ADO.NET
Dataview component of ADO.NET - A DataView object allows you work with data of DataTable of DataSet object..
Post your comment