I have the connection working with the database but I would like a user to have the ability to view the results in a certain order.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT Bids.Name, Bids.Amount, Bids.County, Bids.JobID, Stedents.Student_ID, Stedents.AverageRating FROM Bids INNER JOIN Stedents ON Bids.Student_ID = Stedents.Student_ID WHERE (Bids.JobID = @JobID) Order by ("ddlOrder.Datasource")>
<SelectParameters>
<asp:QueryStringParameter Name="JobID" QueryStringField="JobID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
All I want is to update the Order by value at the end of the statement when A value is chosen from a dropdown.
This is the asp for the dropdown.
<asp:DropDownList ID="ddlOrder" runat="server">
<asp:ListItem Selected = true>Name</asp:ListItem>
<asp:ListItem>Amount</asp:ListItem>
<asp:ListItem>Rating</asp:ListItem>
<asp:ListItem>County</asp:ListItem>
</asp:DropDownList>
Can someone please help me with this??!!
Open in new window