Hi everyone. I am trying to show data from a sql data source. My Columns are as follows: QuizID (Which record the quiz # that the person took), DateTimeComplete (Which shows when the quiz was completed), Score (which is a numeric value that shows the person's score), and UserName(Which is the name of the user that took the quiz). I want the user to be able to view their results in a gridview on the logged in page. However, I obvisouly want to filter the results so that John, for example, does not see his and Jacks scores. I have a

session.add("UserName", User.Identity.Name)

statement that loads the username. However, when I set up the sql source, i use a

WHERE (UserName = @UserName)

to try and limit the results in the gridview to only those that the user took, based on who is logged in. However, everytime i run the program with the WHERE statement, or any statement other than the SELECT statement, my gridview disappears. Can anyone help?! Thanks so much!!!
P.S. - This isn't for homework!!! :mrgreen:

Recommended Answers

All 2 Replies

gonna need to see more of the code. at a minimum, where you are setting up the database call and the connection between the gridview and the connection

Thanks, but I ended up figuring it out! I needed to add another session.add statement for the database to filter from. thanks though!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.