none
DataView threw OutOfMemory Exception RRS feed

  • Question

  • Hi all,

    When I fill data (58000+ rows) from a query string (select statement) to a dataSet, it works fine. However, when I assign its defaultView to a dataView variable, I got OOM exception.

    here is the code: dtView = dtSet.Tables[0].DefaultView;

    Any idea?

    Thanks,

    Sam.

    Monday, July 18, 2011 11:29 PM

Answers

  • Yes, indeed I used LINQ to SQL to solve this issue which is more simple and clear in syntax.

    Thanks anyway.

    • Marked as answer by EverForest Tuesday, July 19, 2011 7:00 PM
    Tuesday, July 19, 2011 7:00 PM

All replies

  • Generlly speaking you need to use paging/virtual mode for large amount of data. The user cannot see more than a few dozens of records at the same time, why bother bring them all at once?



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, July 19, 2011 1:36 AM
  • Hi Sheng,

     

    Yes you are right, we dont have to show all items to customers, however the information intended not to show to customers, but for query purpose. And the main reason is SQLCE doesn't support SELECT Distinct, that is why we want to use DataView's built-in filter. On our table, there could be hundreds to thousand of records of the same ID but with different value (other fields)

     

    Sam.

    Tuesday, July 19, 2011 3:49 PM
  • the built-in filter is just a regular expression parser with a dictionary as the index if remember correctly. You can probably do that by yourself without the datview overhead, or even store the index on the disk. Alternatively you can group the result set by the ids, only bring records of the same id at a time.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, July 19, 2011 4:19 PM
  • Yes, indeed I used LINQ to SQL to solve this issue which is more simple and clear in syntax.

    Thanks anyway.

    • Marked as answer by EverForest Tuesday, July 19, 2011 7:00 PM
    Tuesday, July 19, 2011 7:00 PM