PrepAway - Latest Free Exam Questions & Answers

should you insert at line 02?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application contains a SqlDataAdapter object named daOrder. The
SelectCommand property of the daOrder object is set. You write the following code
segment. (Line numbers are included for reference only.)
01 private void ModifyDataAdapter() {
02
03 }
You need to ensure that the daOrder object can also handle updates. Which code segment
should you insert at line 02?

PrepAway - Latest Free Exam Questions & Answers

A.
SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);
cb.RefreshSchema();

B.
SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);
cb.SetAllValues = true;

C.
SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);
daOrder.DeleteCommand = cb.GetDeleteCommand();
daOrder.InsertCommand = cb.GetInsertCommand();
daOrder.UpdateCommand = cb.GetUpdateCommand();

D.
SqlCommandBuilder cb = new SqlCommandBuilder(daOrder);
cb.RefreshSchema(); cb.GetDeleteCommand();
cb.GetInsertCommand(); cb.GetUpdateCommand();


Leave a Reply