David Smith

David Smith

  • NA
  • 2k
  • 0

System.OutOfMemory Error over a large dataset 1.5 millions

Apr 19 2012 12:13 AM
Ok everyone I have been struggling with the System.OutOfMemory error when selecting from a large dataset, its over 1.5 million records in the database. The query I am performing is below. How to over come this issue. I really need help.



var ResultSet = from ResultsConcatString in ResultsTable.AsEnumerable()
                                                           join ResultsByMaxDate in concatTable.AsEnumerable()
                                                            on
                                                                new
                                                                {
                                                                    KEY1 = ResultsConcatString.Field<string>("CONCATSTR"),
                                                                    KEY2 = ResultsConcatString.Field<string>("MAXTIME"),
                                                                }
                                                            equals
                                                                new
                                                                {
                                                                    KEY1 = ResultsByMaxDate.Field<string>("CONCATSTR"),
                                                                    KEY2 =   ResultsByMaxDate.Field<string>("WRITE_TIME"),
                                                                }
                                                           select new
                                                           {
                                                               STANDARD_VERSION = ResultsByMaxDate.Field<string>("STANDARD_VERSION"),
                                                               WRITE_TIME = ResultsByMaxDate.Field<string>("WRITE_TIME"),
                                                               IDENTIFICATION = ResultsByMaxDate.Field<string>(IDENTIFICATION"),
                                                               REVISION = ResultsByMaxDate.Field<string>("REVISION"),
                                                               SERIAL_NUMBER = ResultsByMaxDate.Field<string>("SERIAL_NUMBER"),
                                                       
                                                           };


Answers (5)