Software QA (13)
SQL Server (1)
How do I force the Dispose method to be called automatically , as clients can forget to call Dispose method
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method?
Call the Dispose method in Finalize method and in Dispose method suppress the finalize method using GC.SuppressFinalize. Below is the sample code of the pattern. This is the best way we do clean our unallocated resources and yes not to forget we do not get the hit of running the Garbage collector twice.
Note:- It will suppress the finalize method thus avoiding the two trip. Public Class ClsTesting Implements IDisposable Public Overloads Sub Dispose()Implements IDisposable.Dispose ' write ytour clean up code here GC.SuppressFinalize(Me) End Sub Protected Overrides Sub Finalize() Dispose() End Sub End Class
2007-10-23, 8191👍, 0💬
How does ASP.NET maintain state in between subsequent request ? Refer caching chapter.
How To Return Top 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want ...
What is ISO? ISO 9000 is a family of standards for quality management systems. ISO 9000 is maintaine...
How many types of validation controls are provided by ASP.NET ? There are six main types of validati...
How To Apply Filtering Criteria at Group Level? - MySQL FAQs - SQL SELECT Query Statements with GROU...