title: How to dispose DataTable in asp.net before garbage collection by the GC?
body: <p>My application is working 24X7 and I use DataTable for data handling.  </p>
  
  <p>I need to dispose the DataTable everytime. I used Dispose and Clear methods, but the content is only cleared and its instance is still in the memory when I debugged the code.</p>
  
  <p>How can I remove it from memory without depending upon the GC?</p>
  
  <p>Thanks in advance..</p>
  
  <p>EDIT:
  This is my code prototype . i have done it in two ways. </p>
  
  <pre><code> 1     //Methord 1
   2               while (true)
   3               {
   4                   DataTable dt = new DataTable();
   5                   dt.Columns.Add("City", typeof(string));
   6                   dt.Rows.Add("ABC");
   7                   dt.Rows.Add("XYZ");
   8                   dt.Rows.Add("PQR");
   9                   dt.Rows.Add("LMN");
   10                   dt.Dispose();
   11               }
   12    //Methord 2
   13               while (true)
   14               {
   15                   using (DataTable dtable = new DataTable())
   16                   {
   17                       dtable.Columns.Add("City", typeof(string));
   18                       dtable.Rows.Add("ABC");
   19                       dtable.Rows.Add("XYZ");
   20                       dtable.Rows.Add("PQR");
   21                       dtable.Rows.Add("LMN");
   22                   }
   23               }
  </code></pre>
  
  <p>how will the datatable gets disposed ? if you check with breakpoint , you can stil see datatable 'dt' still has values even after calling dispose().even on execution of Line No 11 values are still there.i need to free that memory before execution of line 12 (or before 2nd iteration of while). what should i do here?</p>