SqlDataAdapter: Connection closed on exception?

  • Thread starter Thread starter Pieter
  • Start date Start date
P

Pieter

Hi,

An SqlDataAdapter always opens its Conection and closes it automaticly. But
does it Close the connection also when an exception occured?

I tried to test it, and the connection was everytime closes, but I don't
knwo if this would happen with every type of exception... I googled around
for it but didn't find anything.

Anybody could clear this out,

Thanks,

Pieter
 
You could work on the safe side and place your connection closing code in
the Finally block, since that gets run anyways.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top