Here is the code I am currently having the issue with:
try
{
int realopid = Convert.ToInt16(operatorid);
}
catch (OverflowException)
{
//Create Message Box
MessageBox.Show("Please Scan Valid Operator ID", "Operator ID");
operatorid = Microsoft.VisualBasic.Interaction.InputBox("Scan Operator ID", "Operator ID");
}
string res = lookupName( realopid );
You are defining the
realopidinside the try block. it is only visible there. You should define it outside.