am displying student info in Datagrid. each student belongs to diffrent courses ..here what i am doing is i will approve 2 students per one course by clicking check box in Datagrid

If i click more than 2 students in one paticular couse i want a alert .. here how i write code for restrict checkboxes

My tables:course and student

course table have

cid,

courename,

description,

maxno..

My student table:

sid,

sname,

courseId