View Single Post
  #1 (permalink)  
Old July 12th, 2006, 10:30 AM
jrbancroft jrbancroft is offline
Registered User
Join Date: Jul 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default document.DocumentElement.RemoveChild Error


I keep getting the error: Object reference not set to an instance of an object when I run this code:

private static void RemoveRemainingNode(string filename)
            XmlDocument document = new XmlDocument();


            XmlNode node = document.SelectSingleNode("Host");

<?xml version="1.0"?>

All I am trying to to is remove the line <Host></Host>.

Any Ideas?