I am looking for session management on my windows based application using vb.net. I google it, and found the similar result everywhere, and i got same error.
Session Management in VB.NET
Session Management
This is what i was trying to do
Session("UserId") = admin
Here admin is the variable,
But, i got error in the above line, says Session is not declare. Need Help
Thanks in advance !!
Session is a mechanism to store information about an user only when you are in asp.net.
Usually is used to store some global information/preferences that you need about the user is browsing, for example, the language that web pages should be presented to user.
Each user will have his own session values.
There are other mechanisms to achieve that as viewstate or cookies.
From the tags in your question seems you have a winform application. You cannot use session on windows forms. Usually windows forms applications are intended for one specific user. If you want to store global information/preferences in winforms you can use an static preferences class.