I really need some answer to resolve my problem. Here's the situation,
I wanted to create a student number using mysql database and vb.net in this form:

currentyear-(no. of student in record)

Student no. is auto generated.(the no. of student in record part)

Example:
I entered to school in the year 2006
I am student 141791
therefore my Student no. is 2006-141791.


Please let me know how to code it.
Tnx in advance.

Recommended Answers

All 2 Replies

Presuming you hold year first enrolled in the Student table you are best to use a calculated field in a view that concatenates these to fields

YearEnrolled & '-' & StudentId AS StudentNo

i think u have to use the concatenation , of year and ur auto grnated number then insert it in db .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.