Thursday, 8 September 2016

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

By

Top 10 Ado.Net Interview Questions And Answers

Applicants, who are searching for Interview preparation stuff, may get here Top 10 Ado.Net Interview Questions And Answers we have discussed here for Freshers/Experienced. If you’re appearing for an interview then read out here about Ado.Net most common interview questions along with their correct answers, so keep reading this webpage.As we all know that to get a job when has to go through an interview phase so this section is prepared separately for candidates who are preparing for this Ado.Net Interview. 

Top 10 Ado.Net Interview Questions And Answers
You must check out these Top 10 Ado.Net Interview Questions And Answers for better preparation through this page. For your convenience, on this web page we are giving few basic interview questions of ADO.NET that are frequently asked by the expert panel to hire the most talented and skilled freshers and experienced competitors.

Get Field Wise Interview Questions & Answers  From Here

Top 10 Ado.Net Interview Questions And Answers

Following are some Important and top Ado.Net Interview Questions And Answers for Fresher / Experienced that one must expect to be asked;

Ques1  What is the full form of ADO?
Ans: ActiveX Data Object.

Ques2 What is the DataTable Collection?
Ans: An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects. The DataTable Collection contains all the Data Table objects in a DataSet.

Ques3 What is the use of Data View?
Ans: 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 within data table.


Ques4 What two types of data providers do ADO.NET supply? What determines which one you should use?
Ans: ADO.NET contains the SQL data provider and the OLE DB data provider. Use the sqlDataProvider for SQL Server because it's optimized specifically for this database. Use the OLE DB provider for other databases.

Ques5 What are the two fundamental objects in ADO.NET
Ans: There are two fundamental objects in ADO.NET are:
  • Datareader - connected architecture and
  • Dataset - disconnected architecture.
Ques6 Can we have a web application running without web.Config file?
Ans: Yes


Ques7 What are the main difference between classic ADO and ADO.NET?
Ans: They are some major difference between classic ADO and ADO.NET. They are following as:

ADO
ADO.NET
In ADO we have recordset
In ADO.NET we have dataset
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

Ques8 What is the use of command objects?
Ans: They are used to connect connection object to Data reader or dataset. Following are the methods provided by command object:-

Execute NonQuery
  • 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
Start Your Practice: Top 20 Phone Interview Tips

Ques9 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.

Ques10  How would you connect to a database by using .NET?
Ans: The connection class is used to connect a .NET application with a database.

Few more Ado.Net Interview Questions And Answers

Ques11 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.


Ques12 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
  • RemoveAt: It removes a DataRow object from the DataTable depending on the index position of the DataTable
Ques13 What is the basic use of DataView?
Ans:   DataView represents a complete table or can be a small section of rows depending on some criteria. It is best used for sorting and finding data within a data table. DataView has the following 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 specified row from DataView object.

Ques14 How can we load multiple tables in a DataSet?
Ans:
objCommand.CommandText = "Table1"
objDataAdapter.Fill(objDataSet, "Table1")
objCommand.CommandText = "Table2"
objDataAdapter.Fill(objDataSet, "Table2")

Above is a sample code which shows how to load multiple DataTable objects in one DataSet object. The sample code shows two tables Table1 and Table2 in object ObjDataSet.

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

In order to refer Table1 DataTable, use the Tables collection of the DataSet and the DefaultView object will give you the necessary output.

Ques15 What is the use of CommandBuilder?
Ans: CommandBuilder builds "Parameter" objects automatically.

Candidates who wish to get latest details on recruitments, results, admit cards etc. they may follow us on Facebook or Google Plus through our web portal Privatejobshub.in... Applicants if you have any query related to above mentioned interview question you can ask with us by using the comment box… Our team experts solve your queries in the best way they can.

Take more help from these Interview Preparation Tips

Are You Still Jobless, Get Salary Upto 8.5 Lakhs – Apply Now


0 comments:

Post a Comment

Don't Add Comment with Spam Purpose