0

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:

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Mikecool509
0

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

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.