Error: Overload resolution failed

Discussion in 'ASP .Net' started by Eph0nk, Oct 23, 2003.

  1. Eph0nk

    Eph0nk Guest


    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
    Eph0nk, Oct 23, 2003
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page