Thanks all for the information.
Below are my original codes that will create the xml file physically:
private void convertDataTableToXML()
{
// Duplicate the table and add it to a temporary DataSet
DataSet dataset = new DataSet();
DataTable datatable = premiumTable.Copy();
dataset.Tables.Add(datatable);
// Save the temporary DataSet to XML
StreamWriter streamwriter = new StreamWriter("C://XMLDoc.xml");
dataset.WriteXml(streamwriter);
streamwriter.Close();
}
However, instead of using StreamWriter, I change to MemoryStream.
Below is the codes:
MemoryStream ms = new MemoryStream();
dataset.WriteXml(ms);
ms.Close();
How to I reference the xml file created by MemoryStream for later use? Eg, I
need to extract a node value from the xml file.
Thanks.
Thanks,
Siew Yee