something like below,
registrationNumber.Text=ClassnameDropDownList.SelectedValue+"/"+(Query database to get no.of students in the class)+"/"+DateTime.Now.Year
Database Query should be something like below
select count(S.No) from Student where classname='ABC' and year='2014'