Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2006, 10:32 AM
Authorized User
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ints or Unique IDs?

Hi,

When developing web sites with Asp, DreamWeaver and Access, I've always used Unique IDs for setting things like userID or productID. However, with VWD Express and a .mdf db, this doesn't seem like an easy thing to do, at least not when inserting test data during development. The reason is that the uniqueIDs are 32 or so digits, and I have no idea what to write, and it's tiresome anyway.

I used a (great) book from Wrox (Begninning Asp.Net 2.0) to learn VWD and Asp.Net, and in their examples they actually use ints for setting their productIDs and the like. I'm really surprised to see that in a text book, but that's the way they've done it.

So what's the best practice? What should I do? Please help me out here as I'm really confused!

Thanks in advance,

Pettrer


Coding is indeed a nine-to-five job; nine pm to five am.
__________________
Coding is indeed a nine-to-five job; nine pm to five am.
 
Old June 3rd, 2006, 03:05 PM
Authorized User
 
Join Date: May 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you can set this columns as IDENTITY columns,SQL Sever automaticlly provides values for it when inserting new records into the table.
When setting an Identity column,you must specify an identity seed,which is the first value that SQL Server provides for that column,and an identity increment value.
Find the Column Properties tag,then expand the identity specification item to set the node(Is Identity) to yes.

 
Old June 5th, 2006, 06:19 AM
Authorized User
 
Join Date: Apr 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks! That's exactly what I was looking for!

Pettrer

Coding is indeed a nine-to-five job; nine pm to five am.
 
Old June 5th, 2006, 08:28 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can Access use identity from .NET? I tried to set that up and for some reason it wouldn't seed for me. I had to build a query to manual seed. SQL does the identity right for me though.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Generate Unique values for IDs mphare XSLT 7 November 6th, 2008 12:20 PM
ids dhoward VB.NET 2002/2003 Basics 4 December 17th, 2007 05:46 PM
Dialog Help Ids sumeetpm Visual C++ 0 October 31st, 2006 03:19 PM
Unique Control IDs inside a loop using a varible Joshua Sebastian Classic ASP Basics 2 February 3rd, 2005 10:44 AM
unique login names and incremental user IDs krstofer Classic ASP Basics 8 March 11th, 2004 10:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.