Hello, I just want to know how i will auto generate ID number of student using the following format: 1300001 (wherein 06 is the 2 digit year format followed by the ID number.. which start with 00001) ... The scenario is this: I have a textbox named as txtIDNbe o... then lets say the database is ready for saving record (meaning no record is still existing..) then If the user add the first student record... we should see first if there is existing record, if no record exist then we create the id number of the 1st record to start with 1300001... otherwise, if record is already existing database (assuming there is 2 record that is already inserted(1300001 & 1300002)) then we count the number of record and increment the ID number by 1... so the next id number will be 1300003 and so on....
My problem is What is the csharp code of this?..... i am using SQL Server 2008..... Thanks and God Bless Us All..... :-) I do hope you can help me with is one...
Loading
VulpesPosted Dec 11, 2013, 10:24 AM
http://www.c-sharpcorner.com/Forums/Thread/240140/how-to-manage-this-digit.aspx
except that the ID was 10 digits long instead of 7.
I've modified my own method so that it now produces 7 digit IDs and, if you pass it a null or empty string, produces an ID of 00001 for the current year:
The output is: