Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / November 2005

Tip: Looking for answers? Try searching our database.

DOM.selectNodes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Webster - 09 Nov 2005 22:09 GMT
Well a day on I am still trying to populate a text box on a form with a
field related to a field input to the form from a secondary data source.
As a simple example, I have the Beatles names in a database , if I
select Lennon from the dropdown list, I want to complete at text box on
the form with John.

I am using C#. I can get hold of the text box field with selectSingleNode.

I can get hold of the secondary data source by creating a
DataSourceObject. If I display my secondary datasource objects xml it
looks like this.

<dfs:myFields
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution">
<dfs:dataFields>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="John" Sname="Lennon"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="Paul" Sname="McCartney"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="George" Sname="Harrison"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="Ringo" Sname="Star"/>
</dfs:dataFields></dfs:myFields>

I am trying to select this data into  a nodelist so that I can spin
through it with a foreach statement, compare it to the drop down list
value and populate the textbox. I cannot, however, get my selectNodes
function to select the data. Any help would be appreciated.

IXMLDOMNodeList namelist = myDataObject.DOM.selectNodes("/myFields");
foreach(IXMLDOMNode namenode in namelist)
    {
        thisXDocument.UI.Alert((string)namenode.nodeTypedValue);
    }

Paul Webster
Franck Dauché - 10 Nov 2005 00:33 GMT
Hi Paul,

Have you tried this:
http://www.infopathfaq.com/development.asp?postid=720

Regards,

Franck Dauché

> Well a day on I am still trying to populate a text box on a form with a
> field related to a field input to the form from a secondary data source.
[quoted text clipped - 37 lines]
>
> Paul Webster
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.