You should have to check the values before inserting it into a database
You can check it by that way.
IF EXISTS(SELECT COLUMN1 FROM TABLENAME WHERE COLUMN1 = @COLUMN1 AND COLUMN2 = @COLUMN2)
BEGIN
SELECT 'This student registered already'
END
ELSE
BEGIN
INSERT INTO TABLENAME (COLUMN.......) VALUES (@COLUMN........)
SELECT 'Student registered successfully'
END
You have to display message from SQL to Label control in c#