[AccessD] OT C# Try Catch question

Lawrence Mrazek lmrazek at lcm-res.com
Tue Mar 5 13:10:31 CST 2013


Hi David:

Just an aside, if you need to log your error messages, you may want to
checkout Log4Net, an open source logging tool that is easy to setup, and
allows you to write error messages to the Event Log, DB or Text file. See:
http://logging.apache.org/log4net/ ... plus there are a lot of tutorials
available on the net to help with setup and configuration.

Larry

On Tue, Mar 5, 2013 at 1:02 PM, David McAfee <davidmcafee at gmail.com> wrote:

> You're right.
>
> It's another developer's code, in their own section, so I don't want to go
> correcting them.
> I don't like getting warnings, much less errors, when building the project.
>
> I did remove ex when it wasn't being used, and the warnings did go away.
>
> I tend you use the ex when I put it in, so I didn't even think it wasn't
> needed.
>
> Thanks to both of you.
>
> David
>
> On Tue, Mar 5, 2013 at 10:55 AM, Steve Goodhall <steve at goodhall.info>
> wrote:
>
> > I believe you can write the "catch" without the parameter. Don't have the
> > right machine with me to verify that. I will tey it tonight.
> >
> > Steve Goodhall
> >
> >
> > -----Original message-----
> > From: David McAfee <davidmcafee at gmail.com>
> > To: Access Developers discussion and problem solving <
> > accessd at databaseadvisors.com>
> > Sent: Tue, Mar 5, 2013 18:44:09 GMT+00:00
> > 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<
> http://databaseadvisors.com/mailman/listinfo/accessd>
> > Website: http://www.databaseadvisors.**com<
> http://www.databaseadvisors.com>
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/**mailman/listinfo/accessd<
> http://databaseadvisors.com/mailman/listinfo/accessd>
> > Website: http://www.databaseadvisors.**com<
> http://www.databaseadvisors.com>
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list