Where does the dispose method lie and how can it be used to
clean up resources?
Answers were Sorted based on User's Feedback
Answer / mohan kumar e.
The dispose method is available in System.IDisposable
interface.If you want to provide cleanup mechanism then
implement this interface and provide the definition for
dispose() method.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rutu
Dispose() is available in System.IDisposable interface.
Microsoft has suggested two methods that can be invoked by
the programmer for the release of resources i.e Close() and
Dispose().
If any of the method is invoked by the programmer before
loosing the reference to an object, care must be taken to
avoid finalze() to be invoked on the same object when it is
garbage collected and we can do this using
GC.SuppressFinalise().
Public Sub Dipose()' or Close()
'write code here to release the resources
GC.SuppressFinalize(Me)
End Sub
| Is This Answer Correct ? | 0 Yes | 0 No |
What is satellite assembly? And steps to create satellite assembly?
What is the default value of datetime in c#?
How to print labels in windows form in C# .net
How to transpose rows into columns and columns into rows in a multi-dimensional array?
What are PE(Portable Executable)?
Which types of inheritances does c# support?
What is assembly and dll in c#?
What is .cshtml file?
Is it possible to add two 50 digit numbers in .net? If yes what is the code snippet?
2 Answers Cognizant, W3 Solutions, Zefer,
What is the diff between the System.Array.CopyTo() and System.Array.Clone()?
What?s the difference between System.String and System.StringBuilder classes?
Why do we Need of static class in c#?
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)