<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How to fill more than one Comboboxes from C# code?</title><link>https://www.infopathdev.com:443/forums/thread/9325.aspx</link><pubDate>Tue, 04 Apr 2006 18:51:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9325</guid><dc:creator>hcontreras</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9325.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9325</wfw:commentRss><description>I'm having problems trying to make this happen. I have a Client drop-down listbox and a Project drop-down listbox. I want to populate my Project drop-down listbox based on the clientName selected in the Client drop-down listbox. I have a web service (getProjectsForClient) that's sending back a DataSet.&lt;br /&gt;&lt;br /&gt;Can I see more sample of the actual code you used, or can you help me?&lt;br /&gt;&lt;br /&gt;Here is a sample of my code:&lt;br /&gt;&lt;br /&gt;System.Xml.XmlDataDocument projectsXMLDataDoc = new&lt;br /&gt;                       System.Xml.XmlDataDocument(this.RetDataset);&lt;br /&gt;XmlNode projectListXMLNode = projectsXMLDataDoc.DocumentElement;&lt;br /&gt;DataObject getProjectsForClientDataSource = thisXDocument.DataObjects[2];&lt;br /&gt;IXMLDOMNode dtClientsDataSourceNode = getProjectsForClientDataSource.DOM.selectSingleNode(&lt;br /&gt; "/*[local-name()='myFields']/*[local-name()='dataFields']/*[local-name()='getProjectsForClientResponse']/*[local-name()='getProjectsForClientResult']/*[local-name()='RetDataSet']/*[local-name()='NewDataSet']/*[local-name()='dtClients']");&lt;br /&gt;IXMLDOMNode newRow;&lt;br /&gt;&lt;br /&gt;foreach (XmlNode node in projectListXMLNode.ChildNodes)&lt;br /&gt;{&lt;br /&gt;        newRow = dtClientsDataSourceNode.cloneNode(true);&lt;br /&gt;	newRow.selectSingleNode("Name").text =&lt;br /&gt;                                   node.FirstChild.InnerText;&lt;br /&gt;								getProjectsForClientDataSource.DOM.insertBefore(newRow,&lt;br /&gt;                                    dtClientsDataSourceNode);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I've put debug code, and the last statement in the foreach loop is not working. I don't get any errors, but my Project drop-down listbox isn't being filled with my list of values.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by Alex Getman&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I found the solution! :P &lt;br /&gt;&lt;br /&gt;The point is that Infopath Document heavy relies at it's internal xml structure. In code that was provided above I am calling &lt;br /&gt;&lt;br /&gt;documentRoot.appendChild(newRow);&lt;br /&gt;&lt;br /&gt;That works fine if I got only one DataSource of type group inside main Infopath document datasource, but when another datasource was added an exception was trown because it's name was differ from first one.&lt;br /&gt;&lt;br /&gt;So to fill more than one DataSources inside Infopath document, you should use something like:&lt;br /&gt;&lt;br /&gt;documentRoot.insertBefore(newRow, jobRolesList);&lt;br /&gt;&lt;br /&gt;where jobRolesList is the last added DataSource.&lt;br /&gt;&lt;br /&gt;Also you should always keep in mind that all C# code manipulations with Infopath DataSources will hardly depends on it's internal xml structure (xsd schema actually)&lt;br /&gt;&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;</description></item><item><title>Re: How to fill more than one Comboboxes from C# code?</title><link>https://www.infopathdev.com:443/forums/thread/9324.aspx</link><pubDate>Thu, 16 Mar 2006 14:21:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9324</guid><dc:creator>Alex Getman</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9324.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9324</wfw:commentRss><description>I found the solution! :P &lt;br /&gt;&lt;br /&gt;The point is that Infopath Document heavy relies at it's internal xml structure. In code that was provided above I am calling &lt;br /&gt;&lt;br /&gt;documentRoot.appendChild(newRow);&lt;br /&gt;&lt;br /&gt;That works fine if I got only one DataSource of type group inside main Infopath document datasource, but when another datasource was added an exception was trown because it's name was differ from first one.&lt;br /&gt;&lt;br /&gt;So to fill more than one DataSources inside Infopath document, you should use something like:&lt;br /&gt;&lt;br /&gt;documentRoot.insertBefore(newRow, jobRolesList);&lt;br /&gt;&lt;br /&gt;where jobRolesList is the last added DataSource.&lt;br /&gt;&lt;br /&gt;Also you should always keep in mind that all C# code manipulations with Infopath DataSources will hardly depends on it's internal xml structure (xsd schema actually)&lt;br /&gt;</description></item><item><title>Re: How to fill more than one Comboboxes from C# code?</title><link>https://www.infopathdev.com:443/forums/thread/9323.aspx</link><pubDate>Thu, 16 Mar 2006 08:35:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9323</guid><dc:creator>Alex Getman</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9323.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9323</wfw:commentRss><description>Maybe something wrong with my XPath syntax or whole Infopath DataSource filling solution? &lt;br /&gt;&lt;br /&gt;Can you please show me somme better code snippet (if only it exists) for filling Infopath DataSource  from C# code? I've found only this one:&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://aspalliance.com/667&gt;http://aspalliance.com/667&lt;/a&gt;</description></item><item><title>How to fill more than one Comboboxes from C# code?</title><link>https://www.infopathdev.com:443/forums/thread/5447.aspx</link><pubDate>Wed, 15 Mar 2006 13:40:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5447</guid><dc:creator>Alex Getman</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5447.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5447</wfw:commentRss><description>Hi all!&lt;br /&gt;&lt;br /&gt;I've created a new Infopath form called FireOrder and put two comboboxes on it, they are DropDownListEmployees and DropDownListJobRole. Also I've defined two datasources EmployeeList and JobRoleList and specifed dropdownlists's datasources respectively.&lt;br /&gt;&lt;br /&gt;Then I am getting data from WebService as XmlNode and trying to add values for datasource programmatically:&lt;br /&gt;&lt;br /&gt;IXMLDOMNode documentRoot = thisXDocument.DOM.selectSingleNode("/my:FireOrder");&lt;br /&gt;IXMLDOMNode employeesList = thisXDocument.DOM.selectSingleNode("/my:FireOrder/my:EmployeesList");&lt;br /&gt;&lt;br /&gt;string orgunitId = thisXDocument.DOM.selectSingleNode("/my:FireOrder/my:OrgunitId").text;&lt;br /&gt;&lt;br /&gt;// WebService call&lt;br /&gt;XmlNode empList = fireapplication.GetEmployeesList(orgunitId);&lt;br /&gt;&lt;br /&gt;IXMLDOMNode newRow;&lt;br /&gt;foreach (XmlNode node in empList.ChildNodes)&lt;br /&gt;{&lt;br /&gt; newRow = employeesList.cloneNode(true);&lt;br /&gt; newRow.selectSingleNode("my:CODE").text = node.FirstChild.InnerText;&lt;br /&gt; newRow.selectSingleNode("my:EMPLOYEE").text = node.LastChild.InnerText;&lt;br /&gt;&lt;br /&gt; // HERE THE EXCEPTION THROWN&lt;br /&gt; documentRoot.appendChild(newRow);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;and following exception is thrown when code reached commented line:&lt;br /&gt;&lt;br /&gt;Element '&lt;a target="_blank" href=http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-10T09:04:37}EmployeesList'&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-10T09:04:37}EmployeesList'&lt;/a&gt; is unexpected according to content model of parent element '&lt;a target="_blank" href=http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-10T09:04:37}FireOrder'.&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-03-10T09:04:37}FireOrder'.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But the most interesting thing is that when I deleting one of the dropdownlists and its datasource this code works fine and I can see all data from WebService method has been added sucessfully!&lt;br /&gt;&lt;br /&gt;Does anybody knows what can cause this problem? Does Infopath can hold only one DropDownLists to be filled from C# code?</description></item></channel></rss>