<?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: Button to do both, save and submit</title><link>https://www.infopathdev.com:443/forums/thread/35302.aspx</link><pubDate>Thu, 04 Dec 2008 13:43:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35302</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35302.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35302</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Read this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/826993"&gt;http://support.microsoft.com/kb/826993&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Button to do both, save and submit</title><link>https://www.infopathdev.com:443/forums/thread/35296.aspx</link><pubDate>Thu, 04 Dec 2008 13:04:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35296</guid><dc:creator>madhuri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35296.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35296</wfw:commentRss><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Write the below code on onclick event&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;strong&gt;Code for Submitting to DataBase&lt;/strong&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;try&lt;/p&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;string&lt;/font&gt;&lt;font size="2"&gt; empName = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:EmpName&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; empID = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:EmpID&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;/p&gt;SqlConnection dbConn = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; SqlConnection(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Server=Server22;Database=Training_Madhuri;Integrated Security = SSPI&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;SqlCommand nonQueryCommand = dbConn.CreateCommand();&lt;/p&gt;
&lt;p&gt;dbConn.Open();&lt;/p&gt;nonQueryCommand.CommandText = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt;.Format(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;font color="#800000"&gt;insert into Emp (id,EmpName,Department)values (&amp;quot; + id + &amp;quot;&amp;#39;,&amp;#39;&amp;quot; + EmpName + &amp;quot;&amp;#39;,&amp;#39;&amp;quot; + Depatment + &amp;quot;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;nonQueryCommand.ExecuteNonQuery();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;catch&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Exception&lt;/font&gt;&lt;font size="2"&gt; ex)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;thisXDocument.UI.Alert(ex.Message);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code For Submitting to SharePoint:&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;DAVAdapter&lt;/font&gt;&lt;font size="2"&gt; SharePoint = (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;DAVAdapter&lt;/font&gt;&lt;font size="2"&gt;)thisXDocument.DataAdapters[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;SharePoint Library Submit&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;SharePoint.FileName = fileName;&lt;/p&gt;
&lt;p&gt;SharePoint.FolderURL = SharePointURL;&lt;/p&gt;
&lt;p&gt;SharePoint.Submit();&lt;/p&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;</description></item><item><title>Re: Button to do both, save and submit</title><link>https://www.infopathdev.com:443/forums/thread/35286.aspx</link><pubDate>Thu, 04 Dec 2008 11:22:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35286</guid><dc:creator>pablavo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35286.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35286</wfw:commentRss><description>&lt;p&gt;Thanks for getting back to me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I understand that I will have to use code to submit and then save, my problem is that I don&amp;#39;t know how to. Do you know of an article or code that could help me do this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks.&lt;/p&gt;</description></item><item><title>Re: Button to do both, save and submit</title><link>https://www.infopathdev.com:443/forums/thread/35276.aspx</link><pubDate>Thu, 04 Dec 2008 10:40:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35276</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35276.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35276</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;If you want to submit the form to database and SharePoint using one button then you should write the code for both submissions code in one button. Whenever user clicks on that button it will submits to SharePoint and Database.&lt;/p&gt;</description></item><item><title>Button to do both, save and submit</title><link>https://www.infopathdev.com:443/forums/thread/35273.aspx</link><pubDate>Thu, 04 Dec 2008 10:10:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35273</guid><dc:creator>pablavo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35273.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35273</wfw:commentRss><description>&lt;p&gt;Hi folks,&lt;/p&gt;
&lt;p&gt;This is probably quite simple though i&amp;#39;m&amp;nbsp; still new to InfoPath forms.&lt;/p&gt;
&lt;p&gt;The Infopath forms are filled in by users and first the submit button is pressed and then the form is saved to a sharepoint library.&amp;nbsp; The forms information sometimes go out of synch with the values in the database because a user might forget to save a form when updating and when they reopen and update, they will get an error.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I would like to find a way to have one button that will do both, submit the values go the database and save it to the form library as well.&lt;/p&gt;
&lt;p&gt;Does anyone know how I could achieve this?&amp;nbsp; Thanks for any help I receive.&lt;/p&gt;</description></item></channel></rss>