Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What does Dispose method do with the connection object?

Answers were Sorted based on User's Feedback



What does Dispose method do with the connection object?..

Answer / abhishek

SqlConnection.Dispose - in addition to closing the connection, it also
clears stateful nature of the SqlConnection instance, like connection string
etc.Beneath this layer, in SqlConnection atleast, there is a connection
pooling mechanism, which eventually holds actual physical database
connections. Again, they aren't really unmanaged resources, but non .NET
resources nonetheless. Lest I cause any confusion SqlClient has TDS parsing
built into .NET code, so technically in this scenario - there wasn't any
unmanaged resource.

So in short, Dispose does not **have** to release unmanaged resources - and
by convention it does cleanup. Thats exactly what SqlConnection.Dispse
does - "clean up clean up everybody do your share"

Is This Answer Correct ?    3 Yes 1 No

What does Dispose method do with the connection object?..

Answer / guest

Deletes it from the memory.

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More C Sharp Interview Questions

What is type casting. Explain it with reference to classes.

2 Answers   HCL, JPMorgan Chase,


What is string empty?

0 Answers  


How we convert private assembly into public assembly?

0 Answers   Wipro,


Explain the difference between proc. Sent by val and by sub?

0 Answers  


I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?

0 Answers  


What is serialization in unity?

0 Answers  


What is the difference between == and object.equals?

0 Answers  


Where do we set the min and max pool size for connection pooling?

0 Answers  


Explain About remoting and web services. Difference between them

0 Answers   Microsoft,


What is stringbuilder c#?

0 Answers  


how background thread access to ui control?

0 Answers   HCL,


What is dll in vb.net?

0 Answers  


Categories