
Dataset Serialize Outofmemoryexception
Jul 26, 2017 This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use.
When answering a question please: • Read the question carefully. • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome. • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
I've got a DataSet with about 250k Rows and 80 Columns causing StringBuilder to throw an OutOfMemoryException (@System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)) when calling.GetXml() on my dataset. As I read this can be overcome by using binary representation instead of xml, which sounds logical. So I set the RemotingFormat-property on my dataset to binary but the issue still occurs. I had a closer look to the GetXml-implementation and there seems to be no distinction based on the RemotingFormat.
Instead, I found out that GetXmlSchemaForRemoting considers RemotingFormat, but this method is internal so I can't call it from the outside. It is called by private SerializeDataSet which is called by public GetObjectData. GetObjectData itself seems to be for custom serialization.
How can I binary (de-)serialize my dataset? Filelist invite code. Or call at least GetXml without throwing exceptions? Did I overlook any dataset property? The link you provided in you question is from 2008.
There is some more new discussions: and also from. Generic usb hub driver for windows 8. The last one is about problem with DataAdapter while reading 150K records, but the answer can be also interestin for you: The first thing that I'd check is how many columns you are returning, and what their data types are.
And.you are either returning way more fields than you need, or perhaps that some of the fields are very large strings or binary data. Try cutting down the select statement to only return the fields that are absolutely needed for the display. If that doesn't work, you may need to move from a DataTable to a list of a custom data type (a class with the appropriate fields).