[AccessD] OT C# Try Catch question

David McAfee davidmcafee at gmail.com
Tue Mar 5 13:02:57 CST 2013


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>
>


More information about the AccessD mailing list