Select Category 
 

Ado.net Interview Questions Answers

Ado.net Interview Question - 1 : -

 

Explain ACID rule of thumb for transactions.

Ado.net Interview Answer - 1 : -

 

A transaction must be:

1.       Atomic - it is one unit of work and does not dependent on previous and following transactions.

2.       Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.

3.       Isolated - no transaction sees the intermediate results of the current transaction).
4.       Durable - the values persist if the data had been committed even if the system crashes right after. 

 

Ado.net Interview Question - 2 : -

Whate are different types of Commands available with DataAdapter ?

Ado.net Interview Answer - 2 : -

SqlDataAdapter has SelectCommand, InsertCommand, DeleteCommand and UpdateCommand
 

Ado.net Interview Question - 3 : -

 

What does the Initial Catalog parameter define in the connection string?

Ado.net Interview Answer - 3 : -

The database name to connect to.
 

Ado.net Interview Question - 4 : -

 

Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?

Ado.net Interview Answer - 4 : -

Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
 

Ado.net Interview Question - 5 : -

What is the wildcard character in SQL?

Ado.net Interview Answer - 5 : -

 

Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’. 

 

Ado.net Interview Question - 6 : -

Whate are different types of Commands available with DataAdapter ?

Ado.net Interview Answer - 6 : -

The SqlDataAdapter has SelectCommand, InsertCommand, DeleteCommand and UpdateCommand
 

Ado.net Interview Question - 7 : -

What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

Ado.net Interview Answer - 7 : -

SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix.  OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET. 
 

Ado.net Interview Question - 8 : -

What is the role of the DataReader class in ADO.NET connections?

Ado.net Interview Answer - 8 : -

It returns a read-only, forward-only rowset from the data source.  A DataReader provides fast access when a forward-only sequential read is needed. 
 

Ado.net Interview Question - 9 : -

Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Ado.net Interview Answer - 9 : -

 

Let’s take a look at the differences between ADO Recordset and ADO.Net DataSet:

1. Table Collection: ADO Recordset provides the ability to navigate through a single table of information. That table would have been formed with a join of multiple tables and returning columns from multiple tables. ADO.NET DataSet is capable of holding instances of multiple tables. It has got a Table Collection, which holds multiple tables in it. If the tables are having a relation, then it can be manipulated on a Parent-Child relationship. It has the ability to support multiple tables with keys, constraints and interconnected relationships. With this ability the DataSet can be considered as a small, in-memory relational database cache.

2. Navigation: Navigation in ADO Recordset is based on the cursor mode. Even though it is specified to be a client-side Recordset, still the navigation pointer will move from one location to another on cursor model only. ADO.NET DataSet is an entirely offline, in-memory, and cache of data. All of its data is available all the time. At any time, we can retrieve any row or column, constraints or relation simply by accessing it either ordinarily or by retrieving it from a name-based collection.

3. Connectivity Model: The ADO Recordset was originally designed without the ability to operate in a disconnected environment. ADO.NET DataSet is specifically designed to be a disconnected in-memory database. ADO.NET DataSet follows a pure disconnected connectivity model and this gives it much more scalability and versatility in the amount of things it can do and how easily it can do that.

4. Marshalling and Serialization: In COM, through Marshalling

 

Ado.net Interview Question - 10 : -

What are the different rowversions available

Ado.net Interview Answer - 10 : -

  There are four types of Rowversions.
Current:
The current values for the row. This row version does not exist for rows with a RowState of Deleted.

Default : The row the default version for the current DataRowState. For a DataRowState value of Added, Modified or Current, the default version is Current. For a DataRowState of Deleted, the version is Original. For a DataRowState value of Detached, the version is Proposed.

Original:
The row contains its original values.

Proposed:
The proposed values for the row. This row version exists during an edit operation on a row, or for a row that is not part of a DataRowCollection

 

Ado.net Interview Question - 11 : -

 

What connections does Microsoft SQL Server support?

Ado.net Interview Answer - 11 : -

 

Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).

 

Ado.net Interview Question - 12 : -

How xml files and be read and write using dataset?.

Ado.net Interview Answer - 12 : -

DataSet exposes method like ReadXml and WriteXml to read and write xml
 

Ado.net Interview Question - 13 : -

Can you edit data in the Repeater control?

Ado.net Interview Answer - 13 : -

NO.
 

Ado.net Interview Question - 14 : -

What is a pre-requisite for connection pooling?

Ado.net Interview Answer - 14 : -

 

Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.  The connection string must be identical.