XML document error in asp.net

prowl

New Member
This is the code for uploading a XML document to validate. This code gives some exception problem at the line containing the code\[code\]xmlDoc.Load(reader);\[/code\]. The particular exception message is "The Exception was unhandled by the user code". \[code\] private void btnLoad_Click(object sender, System.EventArgs e) { XmlTextReader reader = new XmlTextReader(Server.MapPath("mycompany.xml")); reader.WhitespaceHandling = WhitespaceHandling.None; XmlDocument xmlDoc = new XmlDocument(); //Load the file into the XmlDocument xmlDoc.Load(reader); //Close off the connection to the file. reader.Close(); //Add and item representing the document to the listbox lbNodes.Items.Add("XML Document"); //Find the root nede, and add it togather with its childeren XmlNode xnod = xmlDoc.DocumentElement; AddWithChildren(xnod,1); }\[/code\]
 
Back
Top