943,840 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2454
  • ASP.NET RSS
Mar 19th, 2007
0

Get a Session state from a Query

Expand Post »
HI

I was wondering if anyone knew of a way to store a session state variable from a Query based on information in an access database

What i want to do is when the user logs in they supply their email address and password to log into site I want to store their CustomerID as a Session Variable to track them as they use the site, is this possible

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lordj17 is offline Offline
1 posts
since Mar 2007
Mar 22nd, 2007
0

Re: Get a Session state from a Query

Yeah it is possible the best thing to do is connect to a database using the datareader potentially then read and compare fields until you find the one you want. Once you find the user you need add it to a Session variable.

If you are wanting to track where they have been and are entering it into the DB then you will need to on page load just do an insert into the DB of the current page they are on.

Not sure what you are wanting but that is the genearl idea how to do it. I usually don't ever use an access database so i can't help you with that.
Reputation Points: 12
Solved Threads: 0
Light Poster
percent20 is offline Offline
33 posts
since Jan 2005
Mar 23rd, 2007
0

Re: Get a Session state from a Query

When a user logs in i just get his/her details from the database and store the ones i need in a Session. eg..
(rs = my record set)

Session("ID") = rs("ID")
Session("login") = "true"
Session("type") = rs("membertype")

To track the users actions just do what percent20 said.

Reputation Points: 10
Solved Threads: 1
Newbie Poster
bubbliciousbar is offline Offline
7 posts
since Jan 2007
Mar 26th, 2007
0

Re: Get a Session state from a Query

dont you use the built in memebership providers? all the information is done for you. When a user is logged in and you need to know their information at any time just call Membership.GetUser() and it will return the current logged in user who made the request. It caches it too if you call it more than once in the page. Then you can use the profile provider too.
Much more powerful and easier to use than roll your own
Reputation Points: 26
Solved Threads: 11
Posting Whiz in Training
f1 fan is offline Offline
275 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to transfer values between ASP.NET pages
Next Thread in ASP.NET Forum Timeline: 404 Error on Postback





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC