I'm using an SqlDataSource and gridview to display some data, the data being displayed related to the url parameter. So in my case, my url paramter is ?orderid={number} and I want to use that for my query. I've been fiddling about but cant seem to get anywhere with it.
Here is my code;
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:ConnectionString %>" SelectCommand="
SELECT f.filmID, f.filmTitle, f.filmPrice
FROM films f
INNER JOIN orderItems o
ON f.filmID = o.filmID
WHERE (o.orderID = @orderID)">
<SelectParameters>
<asp:QueryStringParameter Name="orderID" QueryStringField="orderid" />
</SelectParameters>
</asp:SqlDataSource>