Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 22nd, 2008, 06:11 AM
Registered User
Join Date: Oct 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incrementing numbers


Looking for a bit of help. I have a request form that when a user opens a new request it populates the ref number straight away. What I'd like it to do it check the db to see what the last number was and increment it by 1 and that is the new ref number, they can then fill it out and submit it.

However there is also another part where if there was an original request that was rejected, a user can go back and re-submit that request with changes however they don't want it to overwrite the original request so what they'd like to happen is the user can search for their previous request and select it. What it needs to do then is take the original ref number, ie 1001 and add an a, b, c etc on the end to show it is a re-submitted request.

I thought about using auto increment in sql however as I've also got to user alphanumeric characters on the ref numbers I don't think this will allow it. I'm a complete newbie so any help would be greatly appreciated


  #2 (permalink)  
Old January 22nd, 2008, 01:22 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

I'm sure there's lots of ways to do this. Here's one idea. Create a table with in SQL with an autoincrement column and a column to insert the users userid, [IDTable], so when the form opens you have the incremented value and its association to the user. When you save the form, save all of the data on the form to a second table [Requests]. The Requests table will have a column for the SubmissionID and a column to mark the resubmissions, Resubmissions, making both the SubmissionID and Resubmissions columns ints.

How many resubmissions are you allowed? The alphabet only has 26 letters and you could possibly run out. Whether there is a finite number of submissions or not you could build an alphabet table with an AlphaID column, int (increment). Make an entry with the ID of 0 with nothing in the Alphabet column before turning on autoincrement. That way on the first submission INSERT in the Requests table the AlphaID column will be 0. Successive submissions will find the matching row for the SubmissionID column. If you get a hit then you know this is a resubmit. Then you can add one (1) to the AlphaID column and insert the second (?) resubmission. When you display the reference number you can cast the SubmissionID as a varchar and concatenate the Alphabet column from the Alphabet table.

Hope this helps.


  #3 (permalink)  
Old January 30th, 2008, 12:16 AM
Friend of Wrox
Join Date: Oct 2007
Location: , , .
Posts: 130
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to urtrivedi

please refer following for identity creation


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incrementing the variable value Swetha XSLT 2 April 28th, 2008 04:43 PM
Incrementing Job Order Numbers marclf Access VBA 3 February 29th, 2008 12:34 PM
Incrementing attribute value Pankaj C XSLT 4 October 31st, 2007 05:40 AM
reading and incrementing a value phantom3008 ASP.NET 1.0 and 1.1 Basics 0 April 18th, 2007 10:29 AM
Incrementing a value within a template Tre XSLT 1 March 21st, 2007 09:31 AM

All times are GMT -4. The time now is 07:02 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.