[Mono-list] Npgsql error

Emil Emilov emil at emilov.de
Fri Aug 5 06:50:50 EDT 2005


thanx man, thats an elegant way to do it which I will use from now on :)

Jaroslaw Kowalski wrote:
>> Ok, but how does an exception fit in? You need to know if there was an 
>> error to log it or do additional stuff (like MsgBox.Show etc.).
>>
> 
> How about this:
> 
> try
> {
>    using (resource)
>    {
>    }
> }
> catch (Exception ex)
> {
>    // resource already freed
> }
> 
> or
> 
> using (resource)
> {
>    try
>    {
>    }
>    catch (Exception ex)
>    {
>        // can still access resource here
>    }
> }

-- 
Emil R. Emilov
-----------------------------------------------------------------------
mailto:emil at emilov.de
http://www.emilov.de


More information about the Mono-list mailing list