Saturday, 7 April 2018

010 ADO.Net Interview Question and Answer Part 1


1) What is ADO.NET ?

ADO.NET is a data access Technology from Microsoft. After the introduction of .Net technology first version (
Visual Studio .NET 1.0 ) , the next version Visual Studio .NET 2003 (1.1) Microsoft added ADO.NET Technology . ADO.NET stands for ActiveX  database object. The component of ADO.NET used to connect database and manipulate data. In the earlier version of Visual Studio Microsoft provide ADO. But the introduction of.Net technology, introduce  ADO.NET. which is disconnected in nature and most advance Technology and reduce burden to the database.

2) What are the component of ADO.NET ?

Here are  the component of  ADO.NET.


Connection : Connection is a component establish a connection between database and application. Connection component accept connection string and open a database connection.


Command:Command  is some kind of SQL statement which is fired against a active connection.Command  maybe to insert , update or delete data or maybe  execution of  stored procedure.


Dataareader: DataReader is forward only ,read only component of ADO.Net.
DataReader read data, against command execution and a active connection. DataReader can read more than one result set.

DataSet: DataSet is a component to hold , a copy of fetch query result data . DataSet store the whole output of a  result set along with relationship schema in XML format.

DataAdaptor: DataAdopter  adopt data from database. It is bridging between  DataSet and database.

Datatable: Datatable hold data in a tabular format, rows and columns. One dataset can contain multiple datatables.

Dataview: When a filter condition is applied on a datatable, dataview stored the data. You can convert dataview to datatable.




3)Benefit of  ADO.NET ?

  • ADO.NET can communicate over  different kinds of environment.
  • ADO.NET is disconnected in nature, no active continuous connection is required for ADO.NET. When there is a less number of user , database is  almost free . With the growing number of user,  the disconnected architecture helps to handle  a large number of user to be connected to the database.
  • ADO.NET is fast in performance and quick response make an application user-friendly any interesting.

4) What is DataAdopter ?

DataAdopter  is a component of ADO.net , it used make a bridging  between  database and DataSet. DataAdaptor accept  connection string or active connection  and command as a parameter , and  execute the  command , after the execution , result is fill into the
DataSet.

5) What is DataReader ?


DataReader is a component of ADO.NET.
DataReader take an active connection to read data. It is forward only, need active connection until the end, multiple record set can be read by a single reader.

6) What is object pooling ?

  Object pooling is a service of MTS, it is supported by Microsoft.Net. Object pooling is a pool of object , to reuse later. When a request for object is come, the objects is first try  to allocate from the pool. This makes performance faster, reduce CPU usage and memories.

7) What is connection pooling ?
 

 Creating a connection is cost. Instead of create a new connection for each query execution ,  pool  is created  to keep live active connection, when a new connection is required, connection is assign from  this pool.

8) What is Datatable ?
 

Datatable is in memory representation of data in tabular format, rows and columns. Datatables allows filter , loop through the rows and columns. Dynamically add rows and columns and delete rows and columns ca be done programatically.

9)What is System.Data class ?
 

 System.Data is a namespace under System  namespace. System.Data  provide some basic class for data manipulation purpose. For example DataSet, Datatable, DataRow DataColumn ,DataView  only be available, when you have added System.Data in your project.

10) Can we  execute stored procedures in a DataAdopter ?

DataAdopter  accept parameters connection string and SQL command.
We can write stored procedure  name  in the  SQL comment. The Stored procedure will be executed , resultant data can be fetch to the DataSet.

11) ADO.NET support transaction processing or not ?

ADO.NET support transaction processing. One or more command  is executed against a single transaction and connection. If all successfully execute, the transaction is committed else rollback the full transaction.

12) What is the difference between ADO and  ADO.NET ?

 

  •  ADO  is based on com component,  ADO.NET is based on.Net  framework common language run time.
  •  ADO  use record set for database connection, which is connected in nature. ADO.NET use DataSet , DataReader  for data manipulation, which is disconnected in nature.
  •  ADO  use continuous connection,ADO.NET use discontinuous connection, fire command only.
  • ADO record set gives us a single view of a row , going forward, scanned database again gives the next row.ADO.NET  fetch data in a single instance table schema.

13) What is the difference between  Data Set and DataReader ?

  •  DataSet  does not need a continuous active connection , DataReader need a continuous active connection until end.
  •  DataSet is XML formatted data within in memory  allocation, DataReader  is forward only, read only component of  ADO.NET.
  • You can update Database from DataSet ,  you cannot update Database from DataReader.
  • DataSet contain multiple Datatable , DataReader  does not contain Datatable, next result set command is used to get the next set of data.
  • You can get any  Table ,row, column data form DataSet by specifying index or name properly. You need to write loop to get data from DataReader.
  • DataSet  instance is created buy new keyword . DataReader  instance is created  by command.ExecuteReader.

14) what is difference between SQL and OLEDB  provider ?

SQL and only OLEDB  both are component of.Net used for data access purpose.SQL  provider used for connecting Microsoft SQL server (7.0 and above ) and OLEDB  is use for  Excel,Access  in Oracle.
But SQL  is faster than  OLEDB.

15) What is Dataview ?

 
Datatable can be filter , and the output is stored in DataView. Dataview is an  class under .Net framework . When Datatable is filter ,
DataView come into picture. Dataview can be converted to Datatable again.










No comments:

Post a Comment

বাঙালির বেড়ানো সেরা চারটি ঠিকানা

  বাঙালি মানে ঘোড়া পাগল | দু একদিন ছুটি পেলো মানে বাঙালি চলল ঘুরতে | সে সমুদ্রই হোক , পাহাড়ি হোক বা নদী হোক। বাঙালির ...