<?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>Connect to SQL in code - Bypass Data Connections</title><link>https://www.infopathdev.com:443/forums/thread/102531.aspx</link><pubDate>Fri, 15 May 2015 09:44:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102531</guid><dc:creator>JonSmith</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102531.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=102531</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;So My background is more in Access than in Infopath so I might be approaching this in the wrong way but here is the situation. I have an infopath form that is used to write referrals, alot of demographic information which is stored elsewhere gets typed in manually and I would like to sort this used some data stored on a VIEW in SQL server.&lt;/p&gt;&lt;p&gt;Now if I was in access I would simply open a data connection using DAO or ADO, write the SQL dynamically, update the relevant controls and close the data connection.&lt;/p&gt;&lt;p&gt;&amp;nbsp;My intial attempts to do this in Visual Studio have met with failure, I&amp;#39;ve added what I thought were the appropriate references but it still gives me compile errors.&lt;/p&gt;&lt;p&gt;I want to open the data in code rather than a data connection as I want to be able to only return one record from the server.&lt;/p&gt;&lt;p&gt;Any help or alternative routes will be appreciated.&lt;/p&gt;</description></item></channel></rss>