<?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>Insert Row, then immediately query new row?</title><link>https://www.infopathdev.com:443/forums/thread/70556.aspx</link><pubDate>Fri, 23 Sep 2011 01:22:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70556</guid><dc:creator>Chris Martin (MQS)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70556.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=70556</wfw:commentRss><description>I have an infopath 2007 form using Visual Basic.&lt;br /&gt;&lt;br /&gt;

I am using a submit button to insert into, or update, SQL Server 2008.  Here is what I am doing:&lt;br /&gt;&lt;br /&gt;

1. User fills out the form&lt;br /&gt;
2. Data is submitted to the database&lt;br /&gt;
3. View is switched&lt;br /&gt;
4. Data is queried and repeating tables are populated&lt;br /&gt;&lt;br /&gt;

Currently, I can correctly query the data only AFTER I have closed and re-opened the form.  I would like to be able to immediately query the newly submitted rows.  The data is being inserted into the database before the SQL connections are opened and before the queries are run.  When I step through the code I can switch to the database server and view the new rows long before I try to query them.  So, I know that the data is being inserted correctly, it is just not available to the form until it has been re-opened.&lt;br /&gt;&lt;br /&gt;

All of the SQL connections are done using VB, I have not make any Data Connections using the Infopath interface.</description></item></channel></rss>