1. What is the full form of ADO?
The full form of ADO is ActiveX Data Object.
2. What are the two fundamental objects in ADO.NET?
DataReader and DataSet are the two fundamental objects in ADO.NET.
3. Which namespaces are required to enable the use of databases in ASP.NET pages?
The following namespaces are required to enable the use of databases in ASP.NET pages:
* The System.Data namespace.
* The System.Data.OleDb namespace (to use any data provider, such as Access, Oracle, or SQL)
* The System.Data.SQLClient namespace (specifically to use SQL as the data provider)
4. What is the meaning of object pooling?
Object pooling is a concept of storing a pool (group) of objects in memory that can be reused later as needed. Whenever, a new object is required to create, an object from the pool can be allocated for this request; thereby, minimizing the object creation. A pool can also refer to a group of connections and threads. Pooling, therefore, helps in minimizing the use of system resources, improves system scalability, and performance.
5. Which properties are used to bind a DataGridView control?
The DataSource property and the DataMember property are used to bind a DataGridView control.
6. What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?
We must set the DataSource property and call the DataBind() method.
7. Mention the namespace that is used to include .NET Data Provider for SQL server in .NET code.
The System.Data.SqlClient namespace.
8. What is the difference between OLEDB Provider and SqlClient?
With respect to usage, there is no difference between OLEDB Provider and SqlClient. The difference lies in their performance. SqlClient is explicitly used to connect your application to SQL server directly, OLEDB Provider is generic for various databases, such as Oracle and Access including SQL Server.
Therefore, there will be an overhead which leads to performance degradation.
9. Explain the DataAdapter.Update() and DataSet.AcceptChanges() methods.
The DataAdapter.Update() method calls any of the DML statements, such as the UPDATE, INSERT, or DELETE statements, as the case may be to update, insert, or delete a row in a DataSet. The DataSet.Acceptchanges() method reflects all the changes made to the row since the last time the AcceptChanges() method was called.
10. Which architecture does Datasets follow?
Datasets follow the disconnected data architecture.
11. What is the role of the DataSet object in ADO.NET?
One of the major component of ADO.NET is the DataSet object, which always remains disconnected from the database and reduces the load on the database.
12. Which property is used to check whether a DataReader is closed or opened?
The IsClosed property is used to check whether a DataReader is closed or opened. This property returns a true value if a Data Reader is closed, otherwise a false value is returned.
13. Name the method that needs to be invoked on the DataAdapter control to fill the generated DataSet with data?
The Fill() method is used to fill the dataset with data.
14. What is the use of the Connection object?
The Connection object is used to connect your application to a specific data source by providing the required authentication information in connection string. The connection object is used according to the type of the data source. For example, the OleDbConnection object is used with an OLE-DB provider and the SqlConnection object is used with an MS SQL Server.
15. How would you connect to a database by using .NET?
The connection class is used to connect a .NET application with a database.
16. Out of Windows authentication and SQL Server authentication, which authentication technique is considered as a trusted authentication method?
The Windows authentication technique is considered as a trusted authentication method because the username and password are checked with the Windows credentials stored in the Active Directory.
The SQL Server Authentication technique is not trusted as all the values are verified by SQL Server only.
17. What are the pre-requisites for connection pooling?
The prerequisites for connection pooling are as follows:
* There must be multiple processes to share the same connection describing the same parameters and security settings.
* The connection string must be identical.
18. What are the usages of the Command object in ADO.NET?
The Command object in ADO.NET executes a command against the database and retrieves a DataReader or DataSet object.
19. Which adapter should you use, if you want to get the data from an Access database?
OleDbDataAdapter is used to get the data from an Access database.
20. Which object is used to add a relationship between two DataTable objects?
The DataRelation object is used to add relationship between two DataTable objects.