By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,262 Members | 2,664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,262 IT Pros & Developers. It's quick & easy.

Auto populate / Auto increment in VB ASP.NET

P: 9
Hello, all...

Just finished a handy tutorial that has helped me understand how to auto increment and post to a web page... but its only a Web User Control passing values from VB.NET method statements... I really need the increment and post from a SQL Server 2000 database

See Example:
http://sql-paul.com/lesson27_VB/Default.aspx

See Flowchart/Code Behind (I created it in Visio)
http://sql-paul.com/lesson27_VB/Cont..._Flowchart.htm

Now.... thats all fine and dandy... great tutorial... but how do I increment from a SQL database, rather than just simple little += 1 auto incrementors???

Any help would be greatly appreciated.

Thanks,

Best,
Paul
Jun 3 '09 #1
Share this Question
Share on Google+
3 Replies


100+
P: 145
Do some search on SELECT SCOPE_IDENTITY()
Jun 4 '09 #2

P: 9
thanks, I followed your advice SELECT SCOPE_IDENTITY() and came across a moderator on asp.net, his name is Bob. Bob writes "I needed to retrieve a new ticket number upon insert...." so thats kinda like what I need to do.

Basically, I'm creating this VB.NET form to database project
for a manufacturing company, and they want their employees to click on the web based form and have a brand new reference number autopopulate the field.

Like I mentioned, I don't know how to get the Reference Number/Doc ID on the VB web form to autopopulate from the SQL Server database.

Dorandoran, any chance you have working code available for this scenario?

Thanks,
Best,
Paul
Jun 4 '09 #3

Frinavale
Expert Mod 5K+
P: 9,731
Dorandoran's suggestion puts it best....

You should really do some research on SQL IDENTITY. Using Identities will probably solve your problem for you.
Jun 4 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.