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 EntityDataSource control:
<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 ProductName starts with the query string
value. You need to ensure that the page generates the appropriate database query. What should
you do?

You are developing an ASP.NET web page.
The page includes the following EntityDataSource control:
<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 ProductName starts with the query string
value. You need to ensure that the page generates the appropriate database query. What should
you do?

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

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

C.
Add the following element to the EntityDataSource control:
<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 EntityDataSource control:
<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 0

Your email address will not be published. Required fields are marked *