From: Kjell R. <kje...@da...> - 2013-11-27 08:12:14
|
Den 2013-11-26 17:25 skrev Danny Gorton såhär: > DbCommand objects are disposable and therefore this pattern can most > easily be addressed with the 'using' pattern. I see you are using it > for your reader, you can also use it for your command objects. Or you > can write out your own try...finally blocks if you want (what 'using' > actually emits). For that matter, the code you posted could also use > some protective logic to clean up the connection in case of catastrophy. Thanks. I'll give it a try, and then also create a separate FbCommand for each operation - I currently reuse the same one. I do have try/finally/catch to protect connection and transactions, but I omitted it in the post for brevity and clarity re. the normal flow of operations. Regards, Kjell -- -------------------------------------- Kjell Rilbe DataDIA AB E-post: kj...@da... Telefon: 08-761 06 55 Mobil: 0733-44 24 64 |