protected void DisplayException(string label, Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("An exception was caught during \"{0}\"{1}", label, Environment.NewLine);
sb.AppendFormat("Message:{0}{1}{1}", ex.Message, Environment.NewLine);
sb.Append("The program might not continue to run as expected, please restart the application");
MessageBox.Show(sb.ToString(), "An exception was caught");
}