daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public string ToXML(object oObject)
  2.     {
  3.         XmlDocument xmlDoc = new XmlDocument();
  4.         XmlSerializer xmlSerializer = new XmlSerializer(oObject.GetType());
  5.         using (MemoryStream xmlStream = new MemoryStream())
  6.         {
  7.             xmlSerializer.Serialize(xmlStream, oObject);
  8.             xmlStream.Position = 0;
  9.             xmlDoc.Load(xmlStream);
  10.             return xmlDoc.InnerXml;
  11.         }
  12.     }
  13.    
  14. <fProjectGID><fProjectGID/>
  15.    
  16. XmlDocument doc = new XmlDocument();
  17. doc.Load(file);                          
  18. XmlNode node = doc["Root"]["fProjectGID"]; \ Go to your desired Node
  19. node.RemoveAll(); \It Will remove the  xsi:nil="true"
  20. node.InnerText = " Put Here your desired text";  \ Any Inner Text You want.
RAW Paste Data
Top