RANDALL R ANTHONY
RRANTHON at sentara.com
Tue Mar 5 12:51:44 CST 2013
David, If you're going to use try/catch, use it, ie... Of course the CreateLogFile class needs to be written to handle that... HTH. try { //Some stuff here; } Else { return false; } catch (Exception ex) { CreateLogFile(ex.Message + " Error during whatever it you're trying to do module."); //Write to the error log } -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Tuesday, March 05, 2013 1:42 PM To: Access Developers discussion and problem solving Subject: [AccessD] OT C# Try Catch question Sorry for the OT question, just wondering if someone here knows the answer. try { //Some stuff here; } catch (Exception ex) { return false; } The variable 'ex' is declared but never used You can get rid of the error by doing something like writing ex to the console, but is there a better/standard way of avoiding the warning? Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -------------Disclaimer--------------- This electronic message and its contents and attachments contain information from Sentara Healthcare and is confidential or otherwise protected from disclosure. The information is intended to be for the addressee only. If you are not the addressee, any disclosure, copy, distribution or use of the contents of this message is prohibited. If you have received this electronic message in error, please notify us immediately and destroy the original message and all copies.