eddy556
Member
- Joined
- May 14, 2007
- Messages
- 11
- Programming Experience
- 1-3
Hey I'm using vb.net with xpath in order to access an xml file but I've come across a problem when it comes to loading the xml file into the new XmlDocument(). Here is the code I have:
the expcetion being thrown by this is: System.IO.DirectoryNotFoundException: Could not find a part of the path.
The customers.xml is located in the same folder. I have also tried copying it into the Bin folder to no avail.
Many thanks
VB.NET:
Dim document As XmlDocument document = New XmlDocument()
'Load the XML file into the document object
document.Load("\customers.xml")
Dim noCustomers As Integer
noCustomers = document.SelectNodes("/customers/customer").Count
MsgBox(noCustomers)
the expcetion being thrown by this is: System.IO.DirectoryNotFoundException: Could not find a part of the path.
The customers.xml is located in the same folder. I have also tried copying it into the Bin folder to no avail.
Many thanks