<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Custom Datasource</title><link>https://www.infopathdev.com:443/forums/thread/31191.aspx</link><pubDate>Tue, 05 Aug 2008 09:24:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31191</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31191.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31191</wfw:commentRss><description>&lt;p&gt;Thanks to help elsewhere in this forum, everything is finally slotting into place!&lt;/p&gt;
&lt;p&gt;In case anyone else wants to change the query command to make their datasource connections more efficient it&amp;#39;s actually very simple.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;Set&lt;/font&gt;&lt;font size="2"&gt; myDS = XDocument.DataObjects(&amp;quot;DataSource Name&amp;quot;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;myDS.QueryAdapter.Command = sqlStatement&lt;/p&gt;
&lt;p&gt;myDS.Query&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Custom Datasource</title><link>https://www.infopathdev.com:443/forums/thread/31180.aspx</link><pubDate>Mon, 04 Aug 2008 16:30:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31180</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31180.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31180</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;Is it possible in VBScript in Infopath to filter a secondary data source before it is retrieved? I have an SQL Server database with a few thousand lines returned from the query I run at the moment.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;idea&amp;nbsp;is similar to a question answered elsewhere on the forum, where I copy lines from this, secondary datasource into a local one which are user selected.&lt;/p&gt;
&lt;p&gt;What I would like to do, is use variables to cut down the number of rows returned from the server to save time (it takes ages at the moment!) based on entries in the data source it will be copied to.&lt;/p&gt;
&lt;p&gt;So... in the repeating User section, I have a button saying &amp;quot;Search User&amp;quot;. If the &amp;quot;Name&amp;quot; field has anything in it, the response from this button in a repeating table will be cut down based on the contents of that field. We&amp;#39;ll get into the complexities of setting a variable to be eventObj.Source a bit later. At this early stage I would like to know how I change the databinding (MyDetails) SQL before the data is retrieved so that it doesn&amp;#39;t have to pull back thousands of rows every time.&lt;/p&gt;
&lt;p&gt;Apologies for all the questions today, but this last week has&amp;nbsp;been my first venture into coding for Infopath and all the online help seems to be JScript!&lt;/p&gt;
&lt;p&gt;Thanks in advance everyone.&lt;/p&gt;</description></item></channel></rss>