D
Dave
Hello, I'm wondering why a variable in my selectcommand is not
working.
In Page_Load I have this:
String current_user = User.Identity.Name;
Response.Write(current_user); // verified the string 'djohnson' is
present
But this errors out in the Body ('No value given for one or more
required parameters'):
<asp:AccessDataSource id="AccessDataSource1" runat="server" DataFile =
"upload.mdb" SelectCommand="Select * from Customers WHERE
Login=@current_user"/>
When the username is hard-coded it works fine:
<asp:AccessDataSource id="AccessDataSource1" runat="server" DataFile =
"upload.mdb" SelectCommand="Select * from Customers WHERE
Login='djohnson'"/>
I don't understand it. This is getting frustrating.
working.
In Page_Load I have this:
String current_user = User.Identity.Name;
Response.Write(current_user); // verified the string 'djohnson' is
present
But this errors out in the Body ('No value given for one or more
required parameters'):
<asp:AccessDataSource id="AccessDataSource1" runat="server" DataFile =
"upload.mdb" SelectCommand="Select * from Customers WHERE
Login=@current_user"/>
When the username is hard-coded it works fine:
<asp:AccessDataSource id="AccessDataSource1" runat="server" DataFile =
"upload.mdb" SelectCommand="Select * from Customers WHERE
Login='djohnson'"/>
I don't understand it. This is getting frustrating.