I've got error "System.OutOfMemoryException" if dataSet is too large and the memory is enough. The size of file "file1.xml" is about 36 MB.
What is the way to solve this problem? Thanks in advance.
private XPathDocument GetXML(DataSet ds)
{
ds.WriteXml("file1.xml");
ds.WriteXmlSchema("file1.xsd");
XPathDocument doc = new XPathDocument(new StringReader(ds.GetXml()));
return doc;
}