Sairam Soham

Sairam Soham

  • NA
  • 47
  • 26.7k

Be sure you have enough memory for internal purposes and new

Oct 14 2015 3:03 PM


I got an  unhandled exception of type 'System.OutOfMemoryException' occurred in System.Data.dll

Code Snippet

 DataTable dtMeter = null;

            DataTable dtRevClassAvgByDate = null;

            foreach (DataRow row in ds.Tables[0].Rows)
            {

              
                // Create datatable for each meter

                 dtMeter = new DataTable(row[Global.MeterIdColumnName].ToString());

               
              dtRevClassAvgByDate = new DataTable();

            .......... code...........

            
            }

  dtMeter.Dispose();

                dtRevClassAvgByDate.Dispose();


Would you please let me know what I am missing.

Thanks
SaiRam


Answers (1)