Is it necessary to separately dispose of a SqlConnection as well as a SqlCommand?
I\'m doing some maintenance work on an application and found the following code:
<
yes , it is necessary to dispose the sqlconnection and sqlcommand object after your piece of code gets executed.
Now, there are two ways by which you can achieve this: