Saturday 21 December 2013

Interview Question on Ado.Net

What Is ADO(Active data Object)

  ADO stands for ActiceX Data Objects.It was introduced few years ago as a solution to accessing data that can be found in various forms, not only over a LAN but over the internet. It replaced the data access technologies RDO(Remote Data Objects) and DAO (Data Access Objects).
The difference b/w ADO and ADO.NET is.... more 

What are the Two fundamental object in ADO.NET
There are two fundamental object in ADO.NET
(1) Data Reader
(2) Data Set
The difference b/w Data Set  and Data Reader is... more 

What is the use of command Object?
  • Execute Non Query :-Executes the command defined in the command text property against the connection defined in the connection property for a query that does not return any row (Insert, Update or Delete).Returns an integer indicating the number of rows affected by the query.
  • Execute Reader :- Executes the command defined in the command text property against the connection defined in the connection property.Returns a reader object that in connected to the resulting row set within the data base, allowing the rows to be retrieved.
  • Execute Scalar :-Executes the command defined in the command text property against the column defined in the connection property.Returns only single value the first column of the first row of the resulting row set any other returned columns and rows are discarded.
What are the advantages of ADO.NET 
  • Scalability
  • Data Source Independence
  • Interoperability
  • Strongly Typed Fields
  • Performance
What is the use of Data View 
Data View represents a complete table or can be small of rows depending on some criteria. It is the best used for sorting and finding data with in data table.
DataView dview = new DataView(dtb1);
dview = dataset.Table(0).DefaultView;

What is the Difference b/w dataset clone and copy
Dataset Clone : It only copies structure does not copy data.
Dataset Copy : Copies both structure and data.

Name of some ADO.NET object
  • Connection Object
  • DataReader Object
  • Command Object
  • DataSet Object
  • DataAdapter Object
What is the use of System.Data namespace in Ado.Net
System.Data : This contains the basic objects used for accessing and storing relational data such as dataset,datatable and data relation.

What is the Difference b/w Optimistic" and "Pessimistic" locking?
In Pessimistic locking when user wants to update data it locks the record and till then no one can update data.
In Optimistic locking multiple users can open the same record for updating, thus increase maximum concurrency.

Define Clustered Index?
The Data rows are stored in particular order.It is usually provides faster access  to data than does a non-clustered index. A table contain only one clustered index.
Define Non-Clustered Index?
The Data rows are not stored in particular order. There may be many Non-Clustered index. 
  
Difference B/w Data Set & Record set  Click here

Describe ADO.NET architecture 
ADO.NET provides the efficient way to manipulate the database. It contains the following major components are :
  • DataSet Object
  • Data Providers :
  •       ›› Connection Object :- It provides a connection to the database
           ››Command Object :- which is used to execute a command
           ››DataReader Object :-which provides a forward-only, read only, connected recordset
           ››DataAdapter Object :-which populates a disconnected DataSet with data and performs update
  • DataAdepter : - These are object that connect one or more command object to a dataset object. They provide logic that gets the data from the data store and populates the table in the dataset
  • ›› Method of DataAdepter : - 
                ››Fill Method : - Execute the select command to fill the dataset object with data from the                           data source .
                   ›› Fill Schema :- use the Select command to extract just the schema & creats on empty                               table dataset object
                   ›› Update : - Calls the respective insert command, update command, delete command for                           each inserted , delete row in the dataset. 








No comments:

Post a Comment

C# program Selection Sorting

Selection sort is a straightforward sorting algorithm. This algorithm search for the smallest number in the elements array and then swap i...