1 Replies - 5103 Views - Last Post: 08 September 2010 - 05:13 AM Rate Topic: -----

#1 programmerjiwa  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 84
  • Joined: 29-June 10

Autogenerated ID

Posted 07 September 2010 - 10:00 PM

hi all..
am currently work on web application using asp.net and mssql..
am creating a registration page for user.
i already have existing database(user list) in my database..
now i want to continue the ID number for user..when click submit button the ID have to generate automatically and save into database.

i already create the form and can get the ID number but before submit the form..
currently am using this codes to get ID from databse..
SELECT min(AccountNo) 
FROM (SELECT AccNo + 1 AS AccountNo FROM debtor EXCEPT SELECT AccNo FROM Debtor) 
AS boon WHERE AccountNo >300000000

i use this into my dropDownList.
how i can get the same after click submit button.

Is This A Good Question/Topic? 0
  • +

Replies To: Autogenerated ID

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1533
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Autogenerated ID

Posted 08 September 2010 - 05:13 AM

You have asked this before. You are doing this wrong. It is very bad design to do what you are doing. You should let the database auto-generate the ID when you insert the data into the database.

You WILL run into problems if you continue on the path that you are trying.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1