HI WELCOME TO Sirees

ADO.NET Interview Questions

Leave a Comment

A list of top frequently asked ADO.NET interview questions and answers are given below.


1) What is ADO.NET?

ADO.NET stands for ActiveX Data Objects. It is a major component of .NET framework. It is designed to connect with different databases like SQL, MySQL, Oracle, and MS Access etc.

2) What are the objects of ADO.NET?

The two important objects of ADO.Net are:
  • DataReader
  • DataSet

3) What does DataReader Object do?

The DataReader object of ADO.NET is used to provide access of data from a specified data source. It contains classes to sequentially read data from a data source like Oracle, MS Access, SQL Server etc.

4) Can we load multiple tables in a Dataset?

Yes, you can load multiple tables in a dataset.

5) What are the important features of ADO.NET?

  • ADO.NET provides in built classes to make connection with databases like Oracle, SQL Server, MySQL, MS Access etc.
  • ADO.NET provides in built classes for data manipulation operations like Insert, Update, Delete and Select data.
  • Provide a functionality to combine data from different data sources.
  • Disconnect data architecture for better performance.

6) What are the advantages of ADO.NET?

Following are the advantages of ADO.NET:
  • Programmability
  • Maintainability
  • Interoperability
  • Performance
  • Scalability

7) What are the main differences between classic ADO and ADO.NET?

These are the main differences between ADO and ADO.NET:
ADOADO.NET
ADO have record set.ADO.NET have data adopter and data set.
The objects of ado communicate in binary mode. It uses xml for passing the data.
It supports mostly connection oriented models.It works in disconnected manners.
It derives information about data implicitly at run time based on metadata so it is a costly process. It uses known metadata at design time so it provides better run time performance and more consistent run time behavior. 
It allows only client side cursors.It supports both client side and server side cursors.

8) What is LINQ?

LINQ is a native query language for .NET framework. It is specially designed to support queries with .NET applications. It can be connected with SQL and MS Access.

9) Is it possible to edit data in Repeater control?

No. It is read-only and forward-only control so it is not possible to edit data in repeater control.

10) Which ADO.NET object is very fast in getting data from database?

SqlDataReader object.

11) What is connection pooling?

Connection pooling contains database collections so that the connection can be used or reused whenever there is a request to the database. This technique increases the performance of executing the database commands because there is no need to create new connection.

12) What are the ADO.NET connection pooling parameters?

  • Connection Lifetime: default values is 0.
  • Connection Timeout: default values is 15.
  • Max Pool Size: default values is 100.
  • Min Pool Size: default values is 0.
  • Pooling: default values is true.
  • Incr Pool Size: default values is 5.
  • Decr Pool Size: default values is 1.

13) Do you use stored procedure in ADO.NET?

Yes, You can use stored procedure in ADO.NET. It makes the performance fast because stored procedures are precompiled.

14) What is the use of Dataview?

Dataview is used to represent a whole table or a part of table. It is used for sorting and searching data in the data table.

15) What are the data providers used in ADO.NET

Following are the data providers used in ADO.NET:
  • MS SQL Server
  • OLEDB
  • ODBC

16) What is the difference between Data Reader and Data Adapter?

Data ReaderData Adopter
Data reader is read only, forward only. it is much faster than data adopter.It is comparatively slower.
Data reader facilitates you to open and close connection explicitly.If you use data adopter, the connection is automatically open and closed.
Data reader makes connection to database to perform any operation on data.Data adopter is disconnected

17) What is the usage of the DataSet object in ADO.NET?

DataSet object is one of the major components of ADO.NET. It always remains disconnected from the database and reduces the load on the database.

18) What are the different ADO.NET Namespaces?

A list of ADO.NET Namespaces:
IndexNamespacesDescription
1)system.dataIt contains the definition for columns, relations, tables, database, rows, views and constraints.
2)system.data.sqlclientIt contains the classes that are used to connect to a microsoft sql server database such as sqlcommand, sqlconnection, sqldataadapter.
3)system.data.odbcIt contains classes required to connect to most odbc drivers. These classes include odbccommand,odbcconnection.
4)system.data.oracleclientIt contains classes such as oracleconnection,oraclecommand required to connect to an oracle database.

19) What are the different layers of ADO.NET?

Following are three different layers of ADO.NET:
  • Presentation Layer
  • Business Logic Layer
  • Database Access Layer

20) Why is stored procedure used in ADO.NET?

Stored Procedure is used for following reasons:
  • To improve performance
  • Easy to use and maintain
  • For security
  • Less time taking for execution
  • Less Network Traffic

21) What is the difference between Data Grid and Data Repeater?

Data Grid:
  • Data grid has advance features and facilitates you to do a lot of things like paging and sorting your data without much effort.
  • Data grid can hold text data, but not linked or embedded objects.
Data Repeater:
  • A data repeater doesn?t have the paging feature but it can be done by coding.
  • A data repeater can hold other controls and can embed objects.
  • A data repeater can embed a data grid within it but vice versa not possible.

22) What is the difference between datareader and dataset?

A list of differences between datareader and dataset:
IndexDatareaderDataset
1)Forward only.Loop through dataset.
2)Connected recordset.Disconnected recordset.
3)Single table involved.Multiple tables involved.
4)No relationship required.Relationship between tables maintained.
5)No XML storage.Can be stored as XML.
6)Occupies less memory.Occupies more memory.
7)Read onlyCan do addition /Updation and deletion

23) What is a linked server?

A linked server is used to enable SQL server to execute commands against OLE DB data sources on remote servers.

24) What is the default timeout specified for SqlCommand.CommandTimeout property?

The default timeout for SqlCommand.CommandTimeout property is 30 second.

25) What are the several execute methods of ADO.NET?

These are the different execute methods of ADO.NET command object:
  • ExecuteScalar: It returns single value from the dataset.
  • ExecutenonQuery: It has multiple values and returns resultset from dataset.
  • ExecuteReader: Forwardonly Resultset.
  • ExecuteXMLReader: Build XMLReader object from the SQL Query.

26) What are the important features of ADO.Net 2.0?

Most important features of ADO.NET 2.0:
  • Bulk Copy Operation: It facilitates bulk copy operation from one Data Source to another Data Source.
  • Batch Update: To update n no of rows in a database table in a single call from a program thus by avoiding round trip to database.
  • Data Paging: To read data from a certain index
  • Connection Details: To get detailed info about connections like buffer information, cursor details etc.
  • DataSet.RemotingFormat Property: To make dataset serialized in Binary
  • DataTable's Load and Save Methods: For XML interactions.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.