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

Can we inherit a private class in chsarp? how? explain(with code) ?

4 Answers   Techno Labs,


What are callback methods in c#?

0 Answers  


Describe how a .net application is compiled and executed

0 Answers  


Explain About a class access specifiers and method access specifiers.

0 Answers  


Suppose two interfaces have same method, so how will you implement these methods in derive class?

0 Answers  


Can int be null in c#?

0 Answers  


What is an arraylist in c#?

0 Answers  


Any exceptions are there which are not caught by any catch blocks? what are they?

5 Answers   Honeywell, TCS,


Can enum have methods c#?

0 Answers  


What are the problem with .NET generics?

0 Answers   DELL,


What is a singleton unity?

0 Answers  


What are the differences between static, public and void in c#?

0 Answers  


Categories