User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 375,170 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,237 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1322 | Replies: 3
Reply
Join Date: Mar 2007
Posts: 1
Reputation: lordj17 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lordj17 lordj17 is offline Offline
Newbie Poster

Help Get a Session state from a Query

  #1  
Mar 19th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2005
Posts: 33
Reputation: percent20 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
percent20 percent20 is offline Offline
Light Poster

Re: Get a Session state from a Query

  #2  
Mar 22nd, 2007
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.
Reply With Quote  
Join Date: Jan 2007
Posts: 7
Reputation: bubbliciousbar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bubbliciousbar bubbliciousbar is offline Offline
Newbie Poster

Re: Get a Session state from a Query

  #3  
Mar 23rd, 2007
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.

Reply With Quote  
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation: f1 fan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 10
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Get a Session state from a Query

  #4  
Mar 26th, 2007
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 11:45 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC