Try { con.Open(); } catch(SQlException ex) //if there is an Error Catch it here { Label1.Text = ex.Message; //Display your Error in the Message } Finally //Finnaly dispose all the objects and Close the Connection { if (con != null) { con.Close(); } }
Thank you for posting at Dotnetfunda [Administrator]
try { try { DoEverything(); } catch (Exception ex) { } } catch (Exception ex) { }
Login to post response