Error: Overload resolution failed

E

Eph0nk

Hi,

I get an overload resolution failed error (Overload resolution failed because no accessible 'New' can be called without a narrowing conversion), and I can't seem to find a lot of relevant information by googling the web.


Function GetFromXml(Id As String, Node As String)
Dim NodeValue As String
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Dim xmlNI As XPathNodeIterator
xpathDoc = New XPathDocument(Getpath() & ArticlesXmlFile)
'------- ^^^^^^^^^^^^^^^ ERROR IN LINE ABOVE'
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/articles/article[id=" & Id & "]/" & Node)
While (xmlNI.MoveNext())
'Response.Write(xmlNI.Current.Name + " : " + xmlNI.Current.Value & "<br>")
NodeValue = xmlNI.Current.Value
End While
Return NodeValue
End Function

The GetPath() function just returns the path under the current - the path it returns is checked & is correct (the function gets used in other places without error), only when i call it in this "xpathDoc = New XPathDocument()" part.
If i enter the path manually (XPathDocument(PATH_HERE)) everything works find.

Any idea what causes this? The complete error message is listed below:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30519: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:

Source Error:


Line 122: Dim xmlNav As XPathNavigator
Line 123: Dim xmlNI As XPathNodeIterator
Line 124: xpathDoc = New XPathDocument(GetPath() & ConfigurationSettings.AppSettings("xmlArticlesLocation"))
Line 125: xmlNav = xpathDoc.CreateNavigator()
Line 126: xmlNI = xmlNav.Select("/articles/article/id")



Thanks in advance,
Tim De Vogel
S-Data NV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top