ADO.NET - Data Access Technology
As more the applications are becoming complex, more the data requirements. Most applications need database access. ADO.NET provides a tremendous amoun...
As more the applications are becoming complex,
more the data requirements. Most applications need database access. ADO.NET provides a tremendous amount of flexibility and power for building any kind of application requiring database access.ADO.NET is evolved from ADO (ActiveX Data Objects). Earlier, ADO focused on the connection-oriented approach, i.e. the client has to connect to the data server and remain connected until the whole transaction was completed. This approach was not much successful because, there was wastage of resources as server is engaged till whole process is not completed. As if number of clients increases the performance degrades. To solve these problem Record sets were introduced in ADO. Record Sets act as local data store for every client. The data from server is copied into Record Sets and stored on client. In this way client get disconnected from the server, and works on local data. Finally the changes are stored on data server. This greatly reduced the server load but the problem with this approach was not fully solved. This approach requires COM and supports few data types defined in COM.The above-mentioned problems faced by developers were solved by ADO.NET. It has provided both disconnected approach as well as connected approach. ADO .NET is based on XML, to provide disconnected access. It converts all the data into XML format and removed all the type restrictions.ADO.NET has two major components, Datasets and DataProviders. DataProviders provide connection to database and executes commands on database. The Datasets are core component of the disconnected architecture in ADO.NET. It is in memory representation of in-memory representation of data, providing the data access independent of any data source.Data Providers are components that have been explicitly designed for data manipulation and data access. The Data providers consist of Connection object: It is used to connect to a data source. It contains information regarding server name, data source name, data provider name, user name and password.Command object: It enables execute to database SQL commands.DataReader Object: It enables to read data in fast and efficient manner from database. It is generally used to perform SELECT SQL statement.DataAdapter: It bridges between the DataSet object and the data source. It loads DataSet with data taken from database and reconciles the changes made to the data in the DataSet, back to the data source. DataAdapter provides the disconnected approach.