What will you do to accomplish the task?

You work as an ADO.NET Application Developer for company Inc. The company uses Microsoft Visual
Studio .NET 2008 as its application development platform. You create an ADO.NET application by
using .NET Framework 3.5. The application uses a Microsoft SQL Sever database. You use a DataSet
control in the application. You want to add or refresh rows in the DataSet. You need to ensure that
when you add or refresh row in the DataSet you will get number of rows that are successfully added
or refreshed in the DataSet. What will you do to accomplish the task?

You work as an ADO.NET Application Developer for company Inc. The company uses Microsoft Visual
Studio .NET 2008 as its application development platform. You create an ADO.NET application by
using .NET Framework 3.5. The application uses a Microsoft SQL Sever database. You use a DataSet
control in the application. You want to add or refresh rows in the DataSet. You need to ensure that
when you add or refresh row in the DataSet you will get number of rows that are successfully added
or refreshed in the DataSet. What will you do to accomplish the task?

A.
Use the Update method of the DataAdapter class.

B.
Use the RefreshSchema method of the DataAdapter class.

C.
Use the FillSchema method of the DataAdapter class.

D.
Use the Fill method of the DataAdapter class.

Explanation:
You will use the Fill method of the DataAdapter class. The Fill method of the DataAdapter class
returns the number of rows that are successfully added or refreshed in the DataSet.
Answer C is incorrect. The FillSchema method of the DataAdapter class returns an array of
DataTable objects.
Answer A is incorrect. The Update method of the DataAdapter class returns the number of rows
that are successfully updated from a DataSet.
Answer B is incorrect. The DataAdapter class does not have RefreshSchema method.



Leave a Reply 0

Your email address will not be published. Required fields are marked *