When I load up a grid view (which is supposed to display data of that user). However, when I log in as a user and view the grid view it displays both the current user’s data and others’ data. I want it to only display the current logged in user’s data.
How would I use userid = convert.toint32(session["userId"].tostring()) to check my current logged in user’s username and display only their data from the database’s table?
Just make your query to get the data something like
And then set the parameter to userid
Same way as you’d do a query based on user input.