<?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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17237.aspx</link><pubDate>Fri, 24 Feb 2006 14:49:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17237</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17237.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17237</wfw:commentRss><description>Hi Brandt,&lt;br /&gt;&lt;br /&gt;I'm sorry that the HowTo was not easily understood, I will look into making things more clear.&lt;br /&gt;&lt;br /&gt;It seems that you correctly identified the namespace on the group, but remember each node in the hierarchy can contain a different namespace.&lt;br /&gt;&lt;br /&gt;From your example above, I think something besides namespace issues is going on here and to confirm this I would like you to provide the following screenshots:&lt;br /&gt;&lt;br /&gt;Open the Data Source task pane, select Main from the data source drop-down. Expand all folders (if it is too many to fit on one screen, just expand the relevant ones). Screenshot the Data Source task pane.&lt;br /&gt;&lt;br /&gt;Repeat for all secondary data sources.&lt;br /&gt;&lt;br /&gt;Again, I'm sorry the HowTo did not help, but after providing those screenshots I think I will be able to make things crystal clear.  I know where you're coming from, the first day I started writing code in InfoPath it took me FOREVER to figure out how to actually run queries, but after you figure that little thing out you will be set.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17236.aspx</link><pubDate>Fri, 24 Feb 2006 13:20:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17236</guid><dc:creator>brandt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17236.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17236</wfw:commentRss><description>It's definitely with my code...I appreciate your time management requirements...but , yes-I wish you would debug my code...just this once...I'm sure there are others out there with the same problem...it's frustrating not to find concise examples on how to do this...but I have followed all the advice trails and just dont seem to be able to hook into my query data...&lt;br /&gt;&lt;br /&gt;I'm confused, on one front, about the need to add the namespace for secondary data...it appears to me to be already in the default code???</description></item><item><title>Re: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17235.aspx</link><pubDate>Fri, 24 Feb 2006 08:16:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17235</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17235.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17235</wfw:commentRss><description>Hi Brandt and welcome to our forum!&lt;br /&gt;&lt;br /&gt;Are you saying that Matt's HowTo needs to be debugged or that you want us to debug your code? If the former, we will investigate. If the latter, we can help, but this is such a common error that if we helped everyone we would be out of business in no time and you would have no forum at all... do you want that? :) :) &lt;br /&gt;&lt;br /&gt;On the other gland, 10 hours is just too long. You should ask for help after 30 minutes max.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPath Dev Seattle</description></item><item><title>Re: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17234.aspx</link><pubDate>Fri, 24 Feb 2006 03:47:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17234</guid><dc:creator>brandt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17234.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17234</wfw:commentRss><description>LOL...thats what I figured...but your article doesnt help me much...you tell me what they should be??? I need this debugged.&lt;br /&gt;&lt;br /&gt;Here is what I get when  I follow your advice per&lt;a target="_blank" href=http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&gt;http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;vwCustomerInfo_basic (Group)&lt;br /&gt;&lt;br /&gt;Namespace:&lt;a target="_blank" href=http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&gt;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;/a&gt;&lt;br /&gt;Minimum occurrences: 0&lt;br /&gt;Maximum occurrences: unbounded&lt;br /&gt;Default value: [none]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That namespace IS declared...done by IP in the namespaces area...is this the Customer namespace you mentioned?&lt;br /&gt;&lt;br /&gt;I added:&lt;br /&gt;XDocument.GetDOM( "vwCustomerInfo_basic" ).setProperty( &lt;br /&gt;"SelectionNamespaces" , &lt;br /&gt;'xmlns:d0="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"&lt;br /&gt;' ); &lt;br /&gt;to make it reference d0...is this correct?Then I used d0 to try to get to the fields....how can I tell if my query ran successfully and actually has data? Is it possible that my problem is with no data set returned? BTW-I've been researching this for ~10 hrs...got an example using Secondary Data sources from SQL server to do what I am attempting? I can send you screen shots if neccessary.</description></item><item><title>Re: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17233.aspx</link><pubDate>Fri, 24 Feb 2006 03:19:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17233</guid><dc:creator>brandt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17233.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17233</wfw:commentRss><description>&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 MFaus&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I think this is a namespace issue, check out this HowTo, maybe it will help:&lt;a target="_blank" href=http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&gt;http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You will want to check the namespace of each element, so answer these questions:&lt;br /&gt;&lt;br /&gt;What is the namespace for myFields?&lt;br /&gt;What about Customer?&lt;br /&gt;&lt;br /&gt;If they are different, you will have to establish another namespace, d1, that references the second namespace.&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;br /&gt;&lt;br /&gt;By the way, what kind of data connection is this? SharePoint list? Access database? XML file?&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&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: secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/17232.aspx</link><pubDate>Thu, 23 Feb 2006 23:55:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17232</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17232.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17232</wfw:commentRss><description>I think this is a namespace issue, check out this HowTo, maybe it will help:&lt;a target="_blank" href=http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&gt;http://infopathdev.com/howto/tutorials/default.aspx?i=ed2cf0c5895f468995cdd081cf17fead&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You will want to check the namespace of each element, so answer these questions:&lt;br /&gt;&lt;br /&gt;What is the namespace for myFields?&lt;br /&gt;What about Customer?&lt;br /&gt;&lt;br /&gt;If they are different, you will have to establish another namespace, d1, that references the second namespace.&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;br /&gt;&lt;br /&gt;By the way, what kind of data connection is this? SharePoint list? Access database? XML file?&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>secondary data source...where is my data?</title><link>https://www.infopathdev.com:443/forums/thread/16790.aspx</link><pubDate>Thu, 23 Feb 2006 21:40:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16790</guid><dc:creator>brandt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16790.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=16790</wfw:commentRss><description>I keep having trouble with this...I cant seem to get a nonNull reference to &lt;br /&gt;my secondary data...all is well (presumably) until the next to last line of &lt;br /&gt;code...always returns a null reference...anybody care to debug?&lt;br /&gt;/*&lt;br /&gt; * This file contains functions for data validation and form-level events.&lt;br /&gt; * Because the functions are referenced in the form definition (.xsf) file, &lt;br /&gt; * it is recommended that you do not modify the name of the function,&lt;br /&gt; * or the name and number of arguments.&lt;br /&gt; *&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;// The following line is created by Microsoft Office InfoPath to define the &lt;br /&gt;prefixes&lt;br /&gt;// for all the known namespaces in the main XML data file.&lt;br /&gt;// Any modification to the form files made outside of InfoPath&lt;br /&gt;// will not be automatically updated.&lt;br /&gt;//&amp;lt;namespacesDefinition&amp;gt;&lt;br /&gt;XDocument.DOM.setProperty("SelectionNamespaces", &lt;br /&gt;'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &lt;br /&gt;xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields" &lt;br /&gt;xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" &lt;br /&gt;xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" &lt;br /&gt;xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-21T03:22:17" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');&lt;br /&gt;XDocument.GetDOM( "vwCustomerInfo_basic" ).setProperty( &lt;br /&gt;"SelectionNamespaces" , &lt;br /&gt;'xmlns:d0="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" &lt;br /&gt;' );	&lt;br /&gt;//&amp;lt;/namespacesDefinition&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//=======&lt;br /&gt;// The following function handler is created by Microsoft Office InfoPath.&lt;br /&gt;// Do not modify the name of the function, or the name and number of &lt;br /&gt;arguments.&lt;br /&gt;// This function is associated with the following field or group (XPath): &lt;br /&gt;/dfs:myFields/dfs:dataFields/d:tblRAHeader/@CustName&lt;br /&gt;// Note: Information in this comment is not updated after the function &lt;br /&gt;handler is created.&lt;br /&gt;//=======&lt;br /&gt;function msoxd__tblRAHeader_CustName_attr::OnAfterChange(eventObj)&lt;br /&gt;{&lt;br /&gt;// Write code here to restore the global state.&lt;br /&gt;&lt;br /&gt;	if (eventObj.IsUndoRedo)&lt;br /&gt;		{&lt;br /&gt;			// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;			return;&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;// A field change has occurred and the DOM is writable. Write code here to &lt;br /&gt;respond to the changes.&lt;br /&gt;// Retrieve the vwCustomerInfo_basic secondary data source &lt;br /&gt;&lt;br /&gt;	// Retrieve the SQL statement of the data source&lt;br /&gt;	// (the DOM of the vwCustomerInfo_basic Data Object)&lt;br /&gt;	&lt;br /&gt;	var customerInfoAuxDom = XDocument.DataObjects("vwCustomerInfo_basic").DOM&lt;br /&gt;	XDocument.UI.Alert(customerInfoAuxDom == null);&lt;br /&gt;	customerInfoAuxDom.setProperty("SelectionNamespaces", &lt;br /&gt;'xmlns:d0="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"');&lt;br /&gt;		&lt;br /&gt;	var strSQL = &lt;br /&gt;XDocument.DataObjects["vwCustomerInfo_basic"].QueryAdapter.Command;&lt;br /&gt;	XDocument.UI.Alert(strSQL);&lt;br /&gt;	&lt;br /&gt;	var strCustName = eventObj.NewValue;&lt;br /&gt;	XDocument.UI.Alert(eventObj.NewValue);&lt;br /&gt;	&lt;br /&gt;	// Generate the new SQL statement with WHERE clause&lt;br /&gt;	strSQL += " where vwCustomerInfo_basic.Name = ' " + strCustName + " '";&lt;br /&gt;	XDocument.UI.Alert(strSQL);&lt;br /&gt;&lt;br /&gt;	// Populate the command with the new SQL statement&lt;br /&gt;	XDocument.DataObjects["vwCustomerInfo_basic"].QueryAdapter.Command = strSQL;&lt;br /&gt;&lt;br /&gt;	// Run the query&lt;br /&gt;	XDocument.DataObjects["vwCustomerInfo_basic"].Query();&lt;br /&gt;	XDocument.UI.Alert("Query has been run");&lt;br /&gt;	&lt;br /&gt;	// Find the Customer in the secondary data source and the CustomerNum in &lt;br /&gt;the main data source&lt;br /&gt;	var customerAuxNode = customerInfoAuxDom.selectSingleNode( &lt;br /&gt;"/d0:myFields/d0:Customer");  &amp;lt;&amp;lt;&amp;lt;&amp;lt;====== returns TRUE-ie null ref displayed by code below...namespace issue?&lt;br /&gt;&lt;br /&gt;	XDocument.UI.Alert(customerAuxNode == null); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	var strCustomer = customerAuxNode.text;&lt;br /&gt;	XDocument.UI.Alert(strCustomer);&lt;br /&gt;		&lt;br /&gt;	// Update the main data source with the queried value;&lt;br /&gt;	// Populate XML document with customer information.&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;}</description></item></channel></rss>