ADO.NET Interview Questions and Answers (445) - Page 7

What is the use of Command objects?

•ExecuteNonQuery
Executes the command defined in the CommandText 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.

•ExecuteReader
Executes the command defined in the CommandText 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.

•ExecuteScalar
Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns only a 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.
What is the use of a data adapter?

These objects connect one or more Command objects to a DataSet object. They provide logic that would get data from the data store and populates the tables in the DataSet, or pushes the changes in the DataSet back into the data store.

•An OleDbDataAdapter object is used with an OLE-DB provider
•A SqlDataAdapter object uses Tabular Data Services with MS SQL Server.
You have a Customer entity, but it comprises properties that are spread across two tables in the database. What should you do?

NOTE: This is objective type question, Please click question title for correct answer.
When working with the Entity Framework, what can you use to retrieve the SQL of a query?

NOTE: This is objective type question, Please click question title for correct answer.
You create a PerformanceCounter object to view the SQL statements sent to the database server. True or false?

NOTE: This is objective type question, Please click question title for correct answer.
What should you use to capture an exception that might occur when you are sending changes to the database server?

NOTE: This is objective type question, Please click question title for correct answer.
Which are the following valid encryption algorithms that can be used when encrypting the connection strings ?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is a valid symmetric encryption algorithm?

NOTE: This is objective type question, Please click question title for correct answer.
Before you can execute a command on a connection object, which method must you execute to prepare the connection?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories