Hello,
I'm trying to load an xml file residing on the SD Card. The original file is 82kb in size and will not load. But if I reduce the file's size to 1kb it works. The error "CLR_E_OUT_OF_MEMORY" occurs when attempting to load the 82kb file. Does a limitation exist that I'm not aware of? Thanks in advance!!! My code below:
using (StreamReader r = new StreamReader("\\SD\\test.xml"))
{
if (r.BaseStream.Length > 0)
{
do
{
string line = r.ReadToEnd();
Debug.Print(line);
r.Close();
} while (!r.EndOfStream);
}
}
The problem is that your file is too big for the netduino to store on 'line'. try this:
using (StreamReader r = new StreamReader("\\SD\\test.xml"))
{
if (r.BaseStream.Length > 0)
{
do
{
Debug.Print(r.ReadLine());
} while (!r.EndOfStream);
r.Close();
}
}
Each line should be small enough that the netduino can store it in RAM. Let me know if that works out.
EDIT:
You win again Chris
... What Chris said is a good idea too, in case the lines are longer than expected.
By the way, coolest name ever! 'blubblub'
nice