Hello people I'm new here (And new to web develepment) and hope to stay for a wile if you let me ;)
I am trying to construct a WHERE clause on a grid view of a database table I have on a website I am creating in vwd 2005 express, and the datasource for the gridview being an sql server 2005 express database.
I am using the where clause to filter the contents of the gridwiew to show only data particular to the person logged in using the membership login.
So, in the configure datasource wizard I have selected the "where" button for my select statement;
in the "column" field I have selected the name of the column of the table in the gridview, in this case "repID"
in the "Operator" field I have specified "="
in the "source" field I have specified "profile"
in the "parameter source" field I have specified "UserName"
in the "default value" field I have left blank.
What I am trying to do is filter the gridview contents by displaying data with a "repID" the same as the "UserName" of the person logged in. for example if someone logs in with a username of "55501", the select statement will find all the rows with a repid of "55501" and only display them. Whatever the user name is there has to be a repid in the gridview with the same value (in this case 55501, but it could be many things) for anything to be displayed on the page.
Unfortunately when I put the above specifics in the where statement, nothing is displayed when I log in as 55501, no data is displayed, when I specify a default value of 55501, it does work and only shows data with a repid of 55501. But this is no good because I need the gridview filtered based on a username not a default value. So the structure of the statement must be correct, but the "source" and/or "parameter" field values must be incorrect.
Does anyone know where the User name (And is it called UserName) of someone logged in is stored so I can reference it in the "source" field. I have tried using "session" instead of "profile" but the result is exactly the same, the text ""(no data submitted)" is displayed on the page where the results should be.
Any ideas? as I am currently loosing hair.
Thanks in advance.