I am developing an intranet web application which is a Quiz Engine. I have a DataList that shows the available quizzes in the system with showing a short description about each one of them. Now this DataList shows all the quizzes in the Database. What I want is the following: since I have the following database design:
Quiz Table: QuizID, Title, Description, IsSent
*The QuizID is the primary key in that table. IsSent is a flag/boolean that will be true if the quiz was sent to the users.*
Instead of showing all the available quizzes in the database, I want to let this DataList to show only the quiz when it is sent to the users by starting with last sending quiz.
Is this related to the query that I am using right now?
My query is:
SELECT [Title], [Description], [QuizID] FROM [Quiz]
If yes, could you please help me with modifying it?
My ASP.NET Code:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource2">
<ItemTemplate>
<asp:HyperLink
ID="HyperLink1" runat="server" NavigateUrl='<%# "StartQuiz.aspx?testid=" + Eval("QuizID") %>'
Text='<%# Eval("Title") %>'></asp:HyperLink><br />
<asp:Label
ID="DescriptionLabel" runat="server" CssClass="generaltext" Text='<%# Eval("Description") %>'></asp:Label> <br />
<br />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT [Title], [Description], [QuizID] FROM [Quiz]">
</asp:SqlDataSource>
table