SO I am trying to get a simple dataset from the strInstallDataSet string into the dataset, using the code below, when I have the debugger connected I can see that strInstallDataSet has data, byteArray has data, but even after reading msDataset has nothing, length just sits at 0, I have tried setting the position before and after reading but it still just doesn’t pick up any data. Any ideas?
MemoryStream msDataset = new MemoryStream();
if (strInstallDataSet != null)
{
// Convert string to byte array.
byte[] byteArray = Encoding.ASCII.GetBytes(strInstallDataSet);
msDataset.Read(byteArray, 0, byteArray.Length);
// Put stream back into dataset object.
dsInstallData.ReadXml(msDataset);
msDataset.Close();
msDataset.Dispose();
}
You probably want to be doing the following: