Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling session variables within query

Status
Not open for further replies.

ifntech

Programmer
Nov 4, 2004
80
US
What is the syntax to call a session variable within a query within ASP.NET?

Trying something like this (Request is not working)

<script>
Dim Var1 AS String
Var1 = Session("Varone")
Session["Varone"] = "apples";

</script>

The query

SELECT test.field1
FROM testtable
WHERE navigation.var1 = N'<%=Request.session(varone) %>'


 
Put the session variable delcaration in the code behind.

Dim Var1 AS String
Var1 = Session("Varone")
Session["Varone"] = "apples";


Then do your select (in the code behind)
SELECT test.field1
FROM testtable
WHERE navigation.var1 = Session("varone");


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top