c# - converting datatable to xml giving outofmemory exception -
while trying converting datatable data xml through stringwriter. si giving outof memory exception.
my datatable contains 20000 records.
below code trying
datatable dt = getdata();// contains 20000 records. stringwriter sw = new stringwriter(); dt.writexml(sw); xmldocument sd = new xmldocument(); sd.loadxml(sw.tostring());
can me please.
you try using file stream instead of string writer.
filestream stream = file.openread(path); xmldocument doc = new xmldocuemnt(); doc.load(stream);
Comments
Post a Comment