What is Dispose method in .NET?
Answers were Sorted based on User's Feedback
The GC call the Finalize () function automatically to
destroy the object called implicit destroy. When you want
to destroy a objects that you think no longer need and free
it from memory, then we will use the dispose function. For
better
Performance we will use the dispose function explicitly.
The Dispose method in .NET belongs to IDisposable interface
and it is best used to release unmanaged objects like File
objects, Windows API objects, Database connection objects,
COM objects etc from the memory. Its performance is better
than the finalize() method.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / bhasker
The Dispose method may be called on any instance of any type implementing the IDisposable interface. This is supported by the C# using statement which makes calling Dispose automatically easy.
| Is This Answer Correct ? | 0 Yes | 0 No |
how to sort an array in c#
Wht executescaler method is used?
what is the purpose of using statement in c#
what happens if you inherit multiple interfaces and they have conflicting method names?
Explain the role of the datareader class in ado.net connections?
Why do we use ienumerable in c#?
How do you type a null character?
What are the benefits of using generics in c#?
What is connection pooling in ado.net?
What is a constructor in c#?
Overloaded constructor will call default constructor internally?
How we free the memory in C#.NET.
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)