1. What is an ADO.Net?
ADO.Net is commonly termed as ActiveX Data Objects which is a part of .Net Framework. ADO.Net framework has set of classes which are used to handle data access by connecting with different databases like SQL, Access, Oracle, etc…
2. What are two important objects of ADO.Net?
There are two important objects of ADO.Net:
3. What are the key features and benefits of ADO.NET?
Following are the key features of ADO.Net:
Disconnected Data Architecture.
Data cached in DataSet.
Data transfer in XML Format.
Strongly typed language.
Following are the benefits of ADO.Net:
4.What are the namespaces used in ADO.Net to connect to a database?
Following namespaces are used to connect to Database.
The System.Data namespace.
The System.Data.OleDb namespace – A data provider used to access database such as Access, Oracle, or SQL.
The System.Data.SQLClient namespace – Used to access SQL as the data provider.
5.Why is it important to close an ADO.NET application?
Connections need to be closed properly because it affects the scalability and reliability of the applications.
Open connections are always vulnerable to attack, so to be short, ‘Open connections as late as possible and close it as early as possible’. We can ‘Close’ the connections by ‘final’ block or ‘using’ the USING statement.
6.What is Connection Pooling?
Data providers implement ‘Connection pooling’ services. ‘Connection pooling’ improves performance. Connection pooling creates a set of connections.
When you are establishing a connection with the database, you will be given a connection from a pool. When you disconnect from the database, the connection will return to the pool and that connection will be used by the next applicant who wants a connection.
With ‘Connection pooling’ the ‘opening’ and ‘closing’ of connections no longer become an expensive task.
7. What is a Dataset?
Dataset is a disconnected copy of data that gets populated in the client PC. It contains Datatables and Datarelations. Generally, DataAdapter is required for populating a Dataset with the data.
Since it is disconnected, the user no longer need to be connected to the database every time and data manipulations are performed without interacting with the data source. It is very fast and reliable as it resides in the local system.
Two Objects in Dataset
Two Types of Dataset
8.What is DataAdapter?
DataAdapter helps in linking the database and connection object. DataAdapter provides the communication between Dataset and data sources.
Data moves ‘in and out’ of the Dataset through DataAdapter.
Properties of DataAdapter that allow the user to control the database are:
9. What are the data providers in ADO.NET framework?
Below Data Providers are used in ADO.NET framework.
.NET Framework Data Provider for SQL Server – A Data provider that provides access to Microsoft SQL Server 7.0 or later version and it uses the System.Data.SqlClient namespace.
.NET Framework Data Provider for OLE DB – A Data Provider that provides access to any database exposed by using OLE DB and it uses the System.Data.OleDb namespace.
.NET Framework Data Provider for ODBC – A Data Provider that provides access to any databases exposed by using ODBC and It uses the System.Data.Odbc namespace.
.NET Framework Data Provider for Oracle – A Data Provider that provides access to Oracle database 8.1.7 or later versions and it uses the System.Data.OracleClient namespace.
10. What is the difference between ADO and ADO.Net?
ADO works with the connected data whereas ADO.Net works in a disconnected manner. ADO has main object called Recordset which is used to reference data. But ADO.Net has various objects to access the database.
ADO allows creating client side cursors whereas ADO.Net deals with both server side and server side cursors. ADO allows persisting records in XML format and ADO.Net allows to manipulate data using XML.