Wrox Programmer Forums
|
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 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 April 8th, 2008, 01:04 AM
Registered User
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can any one help me pls Urgent..?

Hi

Gud morning...

I am working with Windows Application.. VB.NET

My requirement is , i have one table like dcno., id , name etc..

i want to increment the dcno manually in code

for first time it will check whether any data is inserted for dcno, if not , , i want to set

dcno =1 and the record has been saved , then again i am loading the form

it wil check the database , if any data is ther i t will increment automatically by 1 ...

can any one post the code ...pls.......

Thanks.,....


Regards,
Venkatesan.M
 
Old April 8th, 2008, 08:45 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Doing this manually is generally regarded as a bad practice. What happens if two instance of the problem get the last value (let's say 1) at the same time? They will each try to save a new one as 2 and one will fail.

This is why there are auto increment field settings in many database platforms which makes this operation trivial. The place you set this behavior will vary based on the database you are using.

-Peter
peterlanoie.blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
IFRAMES ...... PLS URGENT raaj Beginning PHP 1 February 28th, 2007 03:39 PM
PHP with IFRAME..pls help me its URGENT raaj Beginning PHP 2 February 26th, 2007 03:12 AM
datagrid problem urgent pls. dsmportal Pro VB.NET 2002/2003 0 February 7th, 2005 09:00 PM
Urgent, Can someone pls explain ? vanjamier Pro JSP 0 December 10th, 2004 02:32 AM





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