• Hi SSCrazy,

    i have a total of 50 questions for a particular test. so i tied:

    SELECT Top(40) [QuestionID], [Title], [Answer1], [Answer2], [Answer3], [Answer4], [CorrectAnswer], [QuestionOrder] FROM [Question] WHERE ([QuizID] = @QuizID) GROUP BY Title ORDER BY NEWID();

    and i got the following error:

    Column 'Question.QuestionID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Column 'Question.QuestionID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

    Source Error:

    Line 14: protected void Page_Load(object sender, EventArgs e)

    Line 15: {

    Line 16: questionDetails.DataBind();

    Line 17: }

    Line 18:

    Source File: c:\Users\ShawnDidy\Desktop\QuizCS\questions.aspx.cs Line: 16