The column index you have specified for the Datarow seems to be wrong.
int returnedLevel = Convert.ToInt32(dr1[0].ToString());
Change the index to 1 instead of 0 // 0 as per the select query is for INST_ID
Also,use else instead of elseif just to check whether the it shows the error incase 1,2,3,7,8 not returned
Please check and revert . Hope this helps...