This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Why Stored Procedure is used in ADO.NET? |
|
Answer» The reasons for USING STORED Procedures in ADO.NET are GIVEN below:
|
|
| 2. |
What are the data providers in ADO.NET? |
|
Answer» Data providers are used to transferring the data between the client application and the data store. It encapsulates the database-specific details. Data providers are HELPFUL for database connection, data retrieval, storing the data in a dataset, reading the retrieved data, and updating the database. The data providers that comes along with the ADO.NET Framework are:
|
|
| 3. |
What are the conditions for connection pooling? |
|
Answer» The CONDITIONS for connection pooling are:
|
|
| 4. |
Name some of the properties and methods provided by the DataReader in ADO.NET? |
|
Answer» Some of the properties provided by the DataReader are as follows:
Some of the methods provided by the DataReader are as follows:
|
|
| 5. |
What is DataTable in ADO.NET? |
|
Answer» DataTable in ADO.NET represents a single table in a DataSet that has in-memory RELATIONAL data. The data within DataTable is local to the .NET framework-based application to which it belongs but can be populated USING a DataAdapter from different data sources such as Microsoft SQL Server. The DataTable CLASS belongs to the System.Data namespace within the LIBRARY of .NET Framework. DataTable can be represented in .aspx.cs code as given below: protected void DataTableExample() { SqlConnection conn = new SqlConnection("Write the database CONNECTION string"); conn.Open(); SqlCommand cd = new SqlCommand("Write the query or procedure", conn); SqlDataAdapter d = new SqlDataAdapter(cd); DataTable dt = new DataTable(); d.Fill(dt); grid.DataSource = dt; grid.DataBind(); }The SQL connection and SQL command object will be created. We pass the SQL query to the object of the SQL command class. A new data table object will be created by using the DataTable class and it is filled with data using a data adapter. |
|
| 6. |
What is Connection pooling? |
|
Answer» The task of grouping DATABASE connections in the cache memory is to make them available whenever there is a requirement of connection. OPENING a new database connection every time is a time-consuming process. Connection pooling allows you to REUSE existing and active database connections, whenever there is a need, and thus increases the application performance. |
|
| 7. |
What is data binding in ADO.NET? |
Answer»
|
|
| 8. |
Explain the difference between OLEDB (Object Linking and Embedding DataBase) and ODBC (Open DataBase Connectivity). |
||||||||||||||
Answer»
|
|||||||||||||||
| 9. |
What is a transaction in ADO.NET? Explain the types of transactions available in ADO.NET. |
|
Answer» In ADO.NET, transactions are used when you want to bind several tasks together and execute them in the form of a single unit. The transaction provides data consistency by ensuring either all of the database operations will be succeeded or all of them will be failed. For example, consider an application that performs two tasks. First, it updates an item_order table with order information. Second, it updates an item_inventory table that holds inventory information, where a number of items ordered will be debited. If any one of the tasks FAILS, then both updates must be rolled back. Two types of transactions supported by ADO.NET are as follows:
|
|
| 10. |
What are the different execute() methods available in ADO.NET? |
|
Answer» Different execute() methods supported by SqlCommandObject in ADO.NET is given below:
|
|
| 11. |
Differentiate DataSet and DataReader. |
||||||||||||
Answer»
|
|||||||||||||
| 12. |
What is object pooling? |
|
Answer» Object pooling is a REPOSITORY of the OBJECTS in memory that can be reused later without creating them. This object pooling reduces the BURDEN of creating objects when it is required. WHENEVER there is a requirement of an object, the object pool manager will process the request and serve accordingly. It is designed for optimizing the use of limited resources so that the demands of CLIENT requests will be fulfilled. |
|
| 13. |
What are the different namespaces available in ADO.NET? |
|
Answer» Various namespaces available under ADO.NET is GIVEN below:
|
|
| 14. |
Explain the difference between DataTable and DataSet. |
||||||||||||||
Answer»
|
|||||||||||||||
| 15. |
Explain about DataSet types in ADO.NET. |
|
Answer» DataSet can be said as a collection of database tables(row and column format) that HOLDS the data. There are two types of DataSet in ADO.NET. They are:
Example program for the usage of DataSet: using System; using System.Data.SqlClient; using System.Data; namespace DataSetDemo { public partial class DataSetExample : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { using (SqlConnection conn = NEW SqlConnection("data source=.; database=employee; integrated security=SSPI")) { SqlDataAdapter DA = new SqlDataAdapter("Select * from employee", conn); DataSet d = new DataSet(); da.Fill(d); GridView1.DataSource = d; GridView1.DataBind(); } } } }Here, DataSet will be filled by DataAdapter that receives data from the employee table. This DataSet will be used to DISPLAY the information received from the employee database. |
|
| 16. |
Explain the difference between ADO.NET and ASP.NET. |
||||||||||
Answer»
|
|||||||||||
| 17. |
What is a DataAdapter in ADO.NET? |
Answer»
Here, DataAdapter will receive the data from the items table and fill the DataSet, which will be later used to display the information retrieved from the items database. |
|
| 18. |
Give the differences between ADO and ADO.NET. |
||||||||||||||||||||||
Answer»
|
|||||||||||||||||||||||
| 19. |
What is DataSet in ADO.NET? |
Answer»
|
|
| 20. |
What is ADO.NET? |
Answer»
|
|