Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 29th, 2010, 10:12 AM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default About ID identities

Hello,

Normally an Id identities to Yes is supposed to go from 1..2..3..4..5..etc. which mean it increment by 1 each time.

However, when entering the Review records.. i push the Enter key in the middle of one record which cause some kind of error message saying there was no commit, etc.. so i continued entering the record then went to the second line and used Ctrl+R to save the record by executing the query.

But it passed from 1 to 3... at the Id. Is there a way to rearrange the Ids.. so it go from 1 to etc..

Thanks.
Reply With Quote
  #2 (permalink)  
Old April 29th, 2010, 10:26 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Yes, sometimes when an error occurs, the ID is already incremented.

Typically, you should be OK with this and not bother about gaps. It will make life a lot easier if gaps in IDs are no problem.

Otherwise, you can delete the records with a higher ID, and set the Identity Seed on the table to the lowest ID available + one.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Rushino (April 29th, 2010)
  #3 (permalink)  
Old April 29th, 2010, 03:13 PM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

Alright thanks!
Reply With Quote
Reply


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
Inserted Identities hossrad SQL Server 2005 1 May 21st, 2007 09:48 AM
How to get the callers ID umair_rathore Pro VB 6 0 April 16th, 2007 11:23 AM
'this.ID = id;' in class construction holf BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 6th, 2006 10:58 AM
ID crmpicco HTML Code Clinic 5 February 10th, 2005 11:50 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM



All times are GMT -4. The time now is 03:48 AM.


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