I want to create a unique customer id in vb.net& sqlserver database
when a save button is clicked i want to insert customer details along with a cust id
inserting code is working
The problem is I, cant crete a cust id of this formatFor Eg.year/name-000001 & so on.....
kindly reply for this auto id creation for each customer entry
thanks in advance
Auto id generation
Page 1 of 11 Replies - 1093 Views - Last Post: 03 October 2012 - 05:26 AM
Replies To: Auto id generation
#2
Re: Auto id generation
Posted 03 October 2012 - 05:26 AM
If the ID is unique, then there is really no reason that the ID should contain the name also.
In other words
ID would be an autoincrement field
To display this information on your forms you would format it by using the values of the two
CustomerAccountNumber would now hold Widgits, Inc-000001
In other words
ID CustName 1 Widgits, Inc. 2 Wonka Chocolates
ID would be an autoincrement field
To display this information on your forms you would format it by using the values of the two
CustomerAccountNumber = reader("CustName").ToString & "-" & Cint(reader("ID").ToString("000000")
CustomerAccountNumber would now hold Widgits, Inc-000001
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|