<?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: Calling xp_fixeddrives from IP form</title><link>https://www.infopathdev.com:443/forums/thread/69295.aspx</link><pubDate>Tue, 16 Aug 2011 03:29:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69295</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69295.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=69295</wfw:commentRss><description>&lt;p&gt;If you use InfoPath&amp;#39;s built-in data connection features to access your own web service, domain trust should be fine as long as the form is published to the same domain as the web service.&amp;nbsp; I think domain trust will still work if they&amp;#39;re not on the same domain, though the user will probably be prompted for approval.&lt;/p&gt;</description></item><item><title>Re: Calling xp_fixeddrives from IP form</title><link>https://www.infopathdev.com:443/forums/thread/69255.aspx</link><pubDate>Mon, 15 Aug 2011 17:06:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69255</guid><dc:creator>lisaa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69255.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=69255</wfw:commentRss><description>&lt;p&gt;Thanks for the info.&amp;nbsp; That did allow me to get the values from the stored procedure output.&amp;nbsp; If I develop my own web service and then simply call it via the InfoPath form, can my form remain Domain trusted?&amp;nbsp; Or does the form still need to be full trust to call my web service?&amp;nbsp; I ask because I&amp;#39;ve only called SharePoint web services from InfoPath to stuff data from the form into a SharePoint list (or read it).&lt;/p&gt;</description></item><item><title>Re: Calling xp_fixeddrives from IP form</title><link>https://www.infopathdev.com:443/forums/thread/69254.aspx</link><pubDate>Mon, 15 Aug 2011 16:46:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69254</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69254.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=69254</wfw:commentRss><description>&lt;p&gt;Typically, forms have to be full trust to execute SQL from code.&amp;nbsp; One way around this is to create and use a web service, which doesn&amp;#39;t require having any code in your form at all.&lt;/p&gt;</description></item><item><title>Calling xp_fixeddrives from IP form</title><link>https://www.infopathdev.com:443/forums/thread/69249.aspx</link><pubDate>Mon, 15 Aug 2011 13:17:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69249</guid><dc:creator>lisaa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69249.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=69249</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to call the stored procedure, xp_fixeddrives, from an InfoPath 2010 but need to make it 2003 compatible if possible.&amp;nbsp; I&amp;#39;m familiar with doing C# coding in the form but calling this stored procedure has me stumped.&amp;nbsp; I&amp;#39;m getting the following exception on the connection.Open() statement below.&amp;nbsp; I&amp;#39;m an admin on the development machine (Win 7/SharePoint installed directly on it) and I have db_owner permissions on the database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;System.Security.SecurityException was unhandled by user code&lt;br /&gt;&amp;nbsp; Message=&amp;quot;Request for the permission of type &amp;#39;System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;#39; failed.&amp;quot;&lt;br /&gt;&amp;nbsp; Source=&amp;quot;mscorlib&amp;quot;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Code sample:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; connString = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=WSS_NTLMOnlyContent;Data Source=.\\Sharepoint;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; connection = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(connString))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Create the command and set its properties.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlCommand&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; command = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlCommand&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;command.Connection = connection;&lt;/p&gt;command.CommandText = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;xp_fixeddrives&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;command.CommandType = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;CommandType&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.StoredProcedure;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Open the connection and execute the reader.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;strong&gt;connection.Open(); &lt;/strong&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;// getting permissions issue&lt;/strong&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlDataReader&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; reader = command.ExecuteReader();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (reader.HasRows)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;while&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (reader.Read())&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Console&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.WriteLine(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;{0}: {1:C}&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, reader[0], reader[1]);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Console&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.WriteLine(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;No rows found.&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;reader.Close();&lt;/p&gt;
&lt;p&gt;} &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// end using&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000"&gt;Does anyone have ideas?&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>