28 October 2013

Top 10 Ado.Net Interview Questions And Answers For Freshers And Experienced 2013

Top 10 Ado.Net Interview Questions And Answers For Freshers And Experienced 2013 : 1. There are huge openings in Dot net in recent days. All the candidates who are appearing for the interviews must go through various interview questions to do well in their interview. Here we have published Top 10 Ado.Net Interview Questions And Answers For Freshers And Experienced.
 

Top 10 Ado.Net Interview Questions1):  ADO stands for ?
Ans: ActiveX Data Object.
 
2): Name the two fundamental objects in ADO.NET?
Ans: Data reader and Data set.

3): Can the web application be runned without web.Config file?

Ans: Yes
4): Difference between classic ADO and ADO.NET?

Ans: ADO.NET has recordset and dataset.
   
In ADO.NET has
In recordset we can only have one table. If we want to create more than one tables. We need to do inner join and fill the recordset.
   
Dataset can have multiple tables.
Data persisted in Binary format.

All data persist in XML

Ques 5): Need for command objects?

Ans: They are used to connect connection object to Data reader or dataset. Following are the methods provided by 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 (an UPDATE, DELETE, or INSERT). 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 is connected to the resulting row set within the database, allowing the rows to be retrieved.

Execute Scalar:

Executes the command defined in the Command Text property against the connection defined in the Connection property. Returns only single value (effectively the first column of the first row of the resulting row set any other returned columns and rows are discarded. It is fast and efficient when only a "singleton" value is required

Ques4): What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

Ans: You must set the DataSource property and call the DataBind () method.
 
5): How to connect to a database by using .NET?

Ans: The connection class is used to connect a .NET
application
with a database.
6): How do we use a Stored Procedure in ADO.NET and how do we provide parameters to the Stored Procedure?

Ans: ADO.NET provides the SqlCommand object which provides the functionality of executing stored procedures.
7): How can we add/remove row in the DataTable object of a Dataset?

Ans: DataTable provides a NewRow method to add a new row to a DataTable. DataTable has a DataRowCollection object that has all the rows in a DataTable object. Following are the methods provided by the DataRowCollection object:

Add: Adds a new row in the DataTable

Remove: It removes a DataRow object from the DataTable

Remove At: It removes a Data Row object from the Data Table depending on the index position of the Data Table
8): What is the basic use of Data View?

Ans:

DataView is a complete table or  small section of rows based on particular criteria. In order to sort and find data within a data table this is used by following the below given methods

Find: It takes an array of values and returns the index of the row.

FindRow: This also takes an array of values but returns a collection of DataRows. If we want to manipulate the data of a DataTable object, create a DataView (using the "Default View", we can create a DataView object) of the DataTable object.

AddNew: Adds a new row to the DataView object.

Delete: Deletes the particular row from DataView object.
9): How to load multiple tables in a DataSet?

Ans:

objCommand.CommandText = "Table1"
objDataAdapter.Fill(objDataSet, "Table1")
objCommand.CommandText = "Table2"
objDataAdapter.Fill(objDataSet, "Table2")

The above given sample code displays how to load multiple DataTable objects in one DataSet object. In this code you can see tables Table1 and Table2 in object ObjDataSet.

lstdata.DataSource = objDataSet.Tables("Table1").DefaultView

Tables collection of the Data Set is used to refer Table 1 Data Table and Default View object gives the output.
 
10): Need for Command Builder?

Ans: Command Builder builds "Parameter" objects automatically.

3. Candidates join us on Facebook for latest news and updates about Top 10 ado.net interview questions and answers. Guys subscribe us for free email alerts and bookmark our page for future reference.


Top 10 Ado.Net Interview Questions And Answers For Freshers And Experienced 2013
4/ 5
Oleh

Thank you for comment