This is something i seeem to get a different answer for, every time i ask a developer. So i thought it would be a good question for the overflow to see what everyone does.
If you have a sqlClient.sqlconnection object, in the cleanup code (finally block etc) do you dispose of the object or do you set it to nothing, or both?
I've always just called the dispose, and allowed the garbage collector to do its thing...
Have a look at my answer to a similar question. Setting a variable to null/Nothing is very rarely necessary. Calling Dispose is necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With