What are the components of .NET DataProvider?
Interview question and answer by: Abhisek
| Posted on: 1/21/2010 | Category: ADO.NET Interview questions
| Views: 1698 |
The .NET DataProvider is a set of components that includes the Connection, Command, DataReader and DataAdapter objects. It is used for connecting to a database , executing commands and retrieving results. Using the .NET data provider we can either access database directly or use the disconnected approach. For the disconnected approach we use DataSet class.
Connection Object:- It is used to connect to the data source. Data source can be any database file. The connection object contains information like the provider name, server name, datasource name, user name and password.
Command Object:- It is used for connect the connection object to a DataReader or DataAdapter object. The command object allow us to execute SQL statement or a stored procedure in a data source.
DataReader Object:- It is used to read the data in a fast and efficient manner from the database. It is generally used to extract one or a few records or specific field values or to execute simple SQL statement.
DataAdapter Object:- It is used to fill data from the database into the DataSet object. it is use din the disconnected approach.
| Alert Moderator
Found interesting? Add this to: