PrepAway - Latest Free Exam Questions & Answers

What should you do to ensure that the data in the updated records is validated before it is saved to the data

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application loads customer records into a DataTable object that is contained
in a database. The records in the DataTable object will be updated by the users of the
application. The data in the updated records might contain errors.You need to ensure that the data in the updated records is validated before it is saved to the database.What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Create an event handler for the TableNewRow event of the DataTable object.
Add a validation code in the event handler to validate the row that is supplied by the DataTableNewRowEventArgs object.

B.
Create an event handler for the RowChanging event of the DataTable object.
Add a validation code in the event handler to validate the row that is supplied by the DataRowChangeEventArgs object.

C.
Call the RejectChanges method of the DataTable object before you save the updated
records to the database.
Call the GetChanges method of the DataTable object to create a copy of the DataTable object that contains the changes.
Add a validation code to validate the DataTable object that contains the changes.

D.
Call the AcceptChanges method of the DataTable object before you save the updated
records to the database.
Call the GetChanges method of the DataTable object to create a copy of the
DataTable object that contains the changes.
Add a validation code to validate the DataTable object that contains the changes.


Leave a Reply