beginner with managed code - InfoPath Dev
in

InfoPath Dev

beginner with managed code

Last post 01-03-2008 07:54 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-28-2007 03:41 AM

    beginner with managed code

    Hi,

    I want to start leraning vb with InfoPath 2007 , browser form with local signatur .

    with this code

    Public Sub btn_code_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)

    ' Fügen Sie hier Code ein.

    Dim wert As XPathNavigator = _

    MainDataSource.CreateNavigator().SelectSingleNode("/my:B-formular/my:system/my:dateiname", NamespaceManager)

    If wert.Value <> "" Then

    MessageBox.Show("Wert: " + wert.Value)

    End If

    End Sub

     

    i get always this message:

    System.Security.SecurityException
    Fehler bei der Anfrage.
       bei Microsoft.Office.InfoPath.MsxmlNavigator.IsValidNode(MsxmlNode test)
       bei Microsoft.Office.InfoPath.MsxmlNavigator.MoveToFirstChild()
       bei MS.Internal.Xml.XPath.XPathChildIterator.MoveNext()
       bei MS.Internal.Xml.XPath.ChildrenQuery.Advance()
       bei MS.Internal.Xml.XPath.ChildrenQuery.Advance()
       bei MS.Internal.Xml.XPath.ChildrenQuery.Advance()
       bei MS.Internal.Xml.XPath.XPathSelectionIterator.MoveNext()
       bei System.Xml.XPath.XPathNavigator.SelectSingleNode(XPathExpression expression)
       bei System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath, IXmlNamespaceResolver resolver)
       bei Buergerschaft.FormCode.btn_code_Clicked(Object sender, ClickedEventArgs e)
       bei Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
       bei Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

     I'ts nearly my first code.

    Perhaps someone has an Idea or better: tip - www-adress odr book for learning step by step writing code with InfoPath and Visual Basic.

     

    Thanks

    Susanne

  • 01-03-2008 07:54 AM In reply to

    Re: beginner with managed code

    Hi mohnsu,

    The best thing I can think of is a problem with the XPath that you put in there.  Make sure to get this XPath by right-clicking the node in Data Source taskpane and selecting "Copy XPath".  This will ensure that you make no typos.

     As for documents on writing managed code, I'm sure there are more out there, including several on our website, but here is one I quickly found with Google: http://www.microsoft.com/downloads/details.aspx?FamilyID=db1d99d9-0a31-45de-8efb-16c75e194dc3&displaylang=en

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.