Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have combo box that connected to sql tbl_course and a label. I want to have a student no. in every course example. In course Computer Technician the student no. should be like this: "COMTECH001" and in course Computer Science the student no. should like this: "COMSCI001". How to increment it by 1 in every student enroll if he chooses course from combo box and display the student no. in label?
I have no idea how to do this in codes. Thanks.
Posted
Updated 1-Apr-13 7:13am
v2
Comments
RedDk 31-Mar-13 13:57pm    
Show some data ...
[no name] 31-Mar-13 14:53pm    
Show some effort.

1 solution

Too many times on this forum we have explainded that using as COMTECH001 or COMSCI001 means bad design of table. Please, use "search" box in the right-top corner of this page.

2 reasons:
1) It's not possible to auto-increment.
2) It's limited to 999 (because of 3 places for numeric values)

Read more:
http://msdn.microsoft.com/en-us/library/ms186775.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900