how to write the Xpath from connection - InfoPath Dev
in

InfoPath Dev

how to write the Xpath from connection

Last post 07-20-2006 11:26 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-19-2006 02:40 AM

    how to write the Xpath from connection

    i have set 2 tables for main connection which connect to my access database. then i am using vb.net to code the project now.

    -myFields
    -dataFields
    -d:tblLeaveInfo
    -Leave_ID(this is a Field Name)
    -tblStaff
    -StaffNo(this is a field name)


    the xpath for main connection is
    thisXDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:tblLeaveInfo/@Leave_ID").text
    *** main table for the connection is running correctly.


    the second table for the main connection is
    thisXDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:tblStaff/@Designation").text
    *** but second table for the main coneection got error message when i try to debug the program.


    error message is

    System.NullReferenceException
    Object reference not set to an instance of an object.
    at InfoPathProject3.InfoPathProject3.CTRLReset_OnClick(DocActionEvent e)
    at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)


  • 07-19-2006 09:26 AM In reply to

    Re: how to write the Xpath from connection

    According to the schema structure you showed, there should be no namespace prefix for tblStaff. That would make your selection as follows:

    thisXDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/tblStaff/@Designation").text

    But if this doesn't work, then I suspect that there is a different namespace being used. You will need to find out what it is: (ns1:tblStaff, or something like that).
  • 07-19-2006 06:13 PM In reply to

    Re: how to write the Xpath from connection

    hi,

    done.
    this is what am i refer to
    http://blogs.msdn.com/infopath/archive/2004/09/13/228881.aspx
    anyway, thanks for your idea.


  • 07-20-2006 11:26 AM In reply to

    Re: how to write the Xpath from connection

    Glad you got the issue resolved and that I was able to help out a bit.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.