PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are implementing an ASP.NET page.
The page includes a method named GetCustomerOrderDataSet that returns a DataSet.
The DataSet includes a DataTable named CustomerDetailsTable and a DataTable named OrderDetailsTable.
You need to display the data in OrderDetailsTable in a DetailsView control named dtlView.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
dtlView.DataSource = GetCustomerOrderDataSet();
dtlView.DataMember = “OrderDetailsTable”;
dtlView.DataBind();

B.
dtlView.DataSource = GetCustomerOrderDataSet();
dtlView.DataSourceID = “OrderDetailsTable”;
dtlView.DataBind();

C.
dtlView.DataSource = GetCustomerOrderDataSet();
dtlView.DataKeyNames = new string [] { “OrderDetailsTable”};
dtlView.DataBind();

D.
DataSet dataSet = GetCustomerOrderDataSet();
dtlView.DataSource = new DataTable(“dataSet”, “OrderDetailsTable”);
dtlView.DataBind();


Leave a Reply