Dmitry,
Usually I will put all the code of a method in the try{}, even the stuff that does not need to be there and do nothing much other than return after the catch{} ... you don't have to put the try/catch only around the code that might cause errors. Don't know if this will help you or not since I haven't seen your code, but try it.
~~Bonnie
>After I added TRY and CATCH blocks to an ASP.NET page that worked, things started falling apart.
>
>First I enclosed the code that creates connection, opens connection and creates a data reader in the TRY { } block. The compiler complained that the Data Reader object and Connection object used after the CATCH {} block were undeclared.
>
>Then I declared the Data Reader and Connection objects before TRY but compiler now complaints that the objects are unassigned (when used after CATCH).
>
>It seems like C# compiler does not recognize anything that goes on inside TRY block.
>
>What am I misunderstanding? Please help.