I am writing xml file but missing some value for specific field. i check that when object comes which contains value that specific value exist but after writing xml value doesn't exist. following is the code which is using. I think XmlTextWriter could be the cause of wrong xml. There is another method which could be used for it that is TextWriter but failed to convert it into memorystream.
string xmlString = null;
MemoryStream memoryStream = new MemoryStream();
XmlSerializer xs = new XmlSerializer(typeof(T));
// XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.ASCII);
TextWriter xmlTextWriter=new StreamWriter(memoryStream,Encoding.ASCII);
memoryStream =(MemoryStream)xmlTextWriter. //(MemoryStream)xmlTextWriter.BaseStream;
xmlString = ASCIIByteArrayToString(memoryStream.ToArray()); return `xmlString;`
Any idea how i can know why and where the problem occur.