PrepAway - Latest Free Exam Questions & Answers

You need to ensure that the page generates the appropriate database query

You are developing an ASP.NET web page.
The page includes the following EntityDataSourcecontrol:
<asp:EntityDataSource ID=”EntityDataSource1″ runat=”server”
ConnectionString=”name=AdventureWorksEntities”
DefaultContainerName=”AdventureWorksEntities” EnableFlattening=”False”
EntitySetName=”Products” />
The page must filter the data that is displayed in a grid on a query string parameter named ProductPrefix.
The grid must display products whose ProductNamestarts with the query string value.
You need to ensure that the page generates the appropriate database query.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Add the following element to the EntityDataSourcecontrol:
<WhereParameters>
<asp:DynamicQueryStringParameter QueryStringField=”ProductPrefix” Name=”ProductName” />
</WhereParameters>

B.
Add the following element to the EntityDataSourcecontrol:
<WhereParameters>
<asp:QueryStringParameter QueryStringField=”ProductPrefix” Name=”ProductName” />
</WhereParameters>

C.
Add the following element to the EntityDataSourcecontrol:
<asp:QueryExtender ID=”QueryExtender1″ runat=”server” TargetControlID=”EntityDataSource1″>
<asp:PropertyExpression Name=”ProductName” />
<asp:DynamicFilterExpression ControlID=”ProductPrefix” />
</asp:QueryExtender>

D.
Add the following element to the EntityDataSourcecontrol:
<asp:QueryExtender ID=”QueryExtender1″ runat=”server” TargetControlID=”EntityDataSource1″>
<asp:SearchExpression SearchType=”StartsWith” DataFields=”ProductName”>
<asp:QueryStringParameter QueryStringField=”ProductPrefix” />
</asp:SearchExpression>
</asp:QueryExtender>


Leave a Reply