Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-26-2008, 06:58 PM   PM User | #1
schristy
New Coder

 
Join Date: Feb 2008
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
schristy is an unknown quantity at this point
getting session variable from autonumber

I have an asp.net vb form that inserts a record into an Access Dbase. One of the fields is an autonumber field (ordernumber) that is generated in Access when the data is added to the dbase.

My problem is this:
I need to set a session variable equal to the ordernumber that is autogenerated right after the record has been added to the dbase.

I originally thought about passing a form variable to a page that would retrieve the record and then grab the value for the ordernumber and set the session variable but I don't have any fields in the form that I could reliably use to differentiate each record. For example, I thought I could use the entered phone number but it is possible for the same phone number to be used for more than one record. Same is true for name, more than one order could come from the same person.

Any suggestions?
schristy is offline   Reply With Quote
Old 04-26-2008, 07:35 PM   PM User | #2
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,472
Thanks: 4
Thanked 40 Times in 40 Posts
Brandoe85 will become famous soon enough
Grab it after you do the insert statement, here is an example on msdn:
http://support.microsoft.com/kb/815629

Good luck
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Old 04-27-2008, 03:49 AM   PM User | #3
schristy
New Coder

 
Join Date: Feb 2008
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
schristy is an unknown quantity at this point
Thanks for the direction.

I'll have to dig through this a bit. I'm using Dreamweaver so these things end up being more of a challenge than I'd like it to be.
schristy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:32 PM.


Advertisement
Log in to turn off these ads.