nerdexam
Microsoft

70-515 · Question #156

You are implementing an ASP.NET page. You add and configure the following ObjectDataSource. <asp:ObjectDataSource SelectMethod="GetProductByProductId" ID="odc" runat="server" TypeName="ProductDAL">…

The correct answer is B. Replace the asp:QueryStringParameter with the following declaration. See the full explanation below for the reasoning.

Question

You are implementing an ASP.NET page. You add and configure the following ObjectDataSource. <asp:ObjectDataSource SelectMethod="GetProductByProductId" ID="odc" runat="server" TypeName="ProductDAL"> <SelectParameters> <asp:Parameter Name="productId" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource> The page will be called with a query string field named pid. You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method. What should you do?

Options

  • AReplace the asp:QueryStringParameter with the following declaration.
  • BReplace the asp:QueryStringParameter with the following declaration.
  • CAdd the following event handler to the Selecting event of the ObjectDataSource control.
  • DAdd the following code segment to the page's code-behind.

How the community answered

(27 responses)
  • A
    19% (5)
  • B
    70% (19)
  • C
    4% (1)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full 70-515 Practice