none
Dataset throws OutofMemoryException RRS feed

  • Question

  • In one of our module we need to fetch huge data (e.g. 700k) from database and we are doing it through dataset; while filling the dataset application is throwing an "Outofmemory" exception. How can I prevent this exception and retrive data into the dataset

    Regards,

    Shashank

     


    Shashank
    Wednesday, February 2, 2011 6:10 AM

Answers

  • My first thought is that's a lot of data and maybe you can retrieve less data into your DataSet? However, I don't think a 700K DataSet should cause an out of memory exception. So, the next question is: how are you filling your DataSet? Are you using the standard methodology with a DataAdapter.Fill() statement? Could you maybe post some code and also show which line of code is throwing the error?


    ~~Bonnie Berent [C# MVP]

    geek-goddess-bonnie.blogspot.com
    Thursday, February 3, 2011 5:54 AM

All replies

  • My first thought is that's a lot of data and maybe you can retrieve less data into your DataSet? However, I don't think a 700K DataSet should cause an out of memory exception. So, the next question is: how are you filling your DataSet? Are you using the standard methodology with a DataAdapter.Fill() statement? Could you maybe post some code and also show which line of code is throwing the error?


    ~~Bonnie Berent [C# MVP]

    geek-goddess-bonnie.blogspot.com
    Thursday, February 3, 2011 5:54 AM
  • Hi ShaShank,

    Welcome to ado.net dataset forum.

    1、Please check with 1 or 100 records, Is ther any error happened?(If so, please paste the error message.)

    2、700K is not huge. Could you paste your code snippet.

    Is there any problem please let me know.

    Have a good day.



    David Peng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 4, 2011 3:19 AM
    Moderator
  • Hi Shashank,


    I will mark the thread as answered, If there are any issues you can unmark it and please let me know.
    We will always on your side  and Thanks to all the participate and your selfness sharing :)
    Have a good day!


    If it's helpful for you, Please vote or mark. Thank you!

    David Peng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 14, 2011 9:30 AM
    Moderator