<?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: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34840.aspx</link><pubDate>Mon, 24 Nov 2008 21:49:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34840</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34840.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34840</wfw:commentRss><description>&lt;p&gt;Thanks. That did it.&lt;/p&gt;
&lt;p&gt;Sorry one more question:&lt;/p&gt;
&lt;p&gt;After clicking on insert item in repeating section, how do I actually save new values in SQL Server? How do I access data fields entered by user?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34833.aspx</link><pubDate>Mon, 24 Nov 2008 21:18:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34833</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34833.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34833</wfw:commentRss><description>&lt;p&gt;Sorry -- source is capitalized: eventObj.Source&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34831.aspx</link><pubDate>Mon, 24 Nov 2008 21:09:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34831</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34831.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34831</wfw:commentRss><description>&lt;p&gt;I am getting &amp;#39;source&amp;#39; is null or not an object. &lt;/p&gt;
&lt;p&gt;Here is my code:&lt;/p&gt;
&lt;p&gt;function btnItemDelete::OnClick(eventObj) {&lt;/p&gt;
&lt;p&gt;var AppContactID = eventObj.source.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:SQLComplexDBList/@AppContactID&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;Any idea why?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34747.aspx</link><pubDate>Sat, 22 Nov 2008 00:04:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34747</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34747.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34747</wfw:commentRss><description>&lt;p&gt;Use eventObj.source instead. I believe in C# the variable is e.&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34741.aspx</link><pubDate>Fri, 21 Nov 2008 19:04:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34741</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34741.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34741</wfw:commentRss><description>&lt;p&gt;Thanks Swathip.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;What is e (e.source.selectSingleNode) in your code? I am getting &amp;#39;e&amp;#39; is undefined when I preview the form.&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34644.aspx</link><pubDate>Fri, 21 Nov 2008 06:02:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34644</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34644.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34644</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In the above code, every time you are getting the first ‘AppContactID&amp;#39;. Instead of that get the current row AppContactID. For that use the following code line.&lt;/p&gt;
&lt;p&gt;var AppContactID = e.source.selectSingleNode(&amp;quot;@AppContactID&amp;quot;).text;&lt;/p&gt;
&lt;p&gt;You can add confirm messages using the following code.&lt;/p&gt;
&lt;p&gt;var answer = confirm (&amp;quot;Write the confirm message here&amp;quot;)&lt;br /&gt;if (answer)&lt;br /&gt;//Continue with your code&amp;nbsp;else&lt;br /&gt;return&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34610.aspx</link><pubDate>Thu, 20 Nov 2008 15:46:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34610</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34610.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34610</wfw:commentRss><description>&lt;p&gt;Sorry more questions:&lt;/p&gt;
&lt;p&gt;As you can see in attached screenshot, I have a repeating table that lists contacts for each database I manage. For each row of the table, I put a Delete button&amp;nbsp;for users to&amp;nbsp;remove the contact. In preview form, when I click on Delete button, I always see the first row being deleted even when I click on Delete button in 2nd and third rows. Here is the code I use to delete.&amp;nbsp;What&amp;nbsp;am I doing&amp;nbsp;wrong?&lt;/p&gt;
&lt;p&gt;function btnDeleteAppContact::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{&amp;nbsp;var AppContactID = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:SQLComplexDBList/@AppContactID&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;if(AppContactID != null) { &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Command = &amp;quot;delete dbo.AppContact where AppContactID = &amp;quot; + AppContactID; &lt;/p&gt;
&lt;p&gt;XDocument.Query(); } }&lt;/p&gt;
&lt;p&gt;--------------------&lt;/p&gt;
&lt;p&gt;How can I add a Confirm Delete popup window before actually deleting a row? I am&amp;nbsp;new to&amp;nbsp;JScript?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;
&lt;p&gt;Ali&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34601.aspx</link><pubDate>Thu, 20 Nov 2008 14:48:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34601</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34601.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34601</wfw:commentRss><description>&lt;p&gt;Thanks. It worked.&lt;/p&gt;</description></item><item><title>Re: Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34541.aspx</link><pubDate>Thu, 20 Nov 2008 05:29:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34541</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34541.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34541</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you want to get the ‘SQLComplexDBID&amp;#39; value then the xpath you are using is not correct. Use the following xpath to get the SQLComplexDBID value.&lt;/p&gt;
&lt;p&gt;function btnDelete::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&amp;nbsp;var SQLComplexDBID = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:SQLComplexDBList/@SQLComplexDBID&amp;quot;).text; &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;if(SQLComplexDBID != null)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;{&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Command = &amp;quot;delete dbo.SQLComplexDB where SQLComplexDBID = &amp;quot; + SQLComplexDBID; &lt;/p&gt;
&lt;p&gt;XDocument.Query();&lt;/p&gt;
&lt;p&gt;&lt;b&gt;}&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;} &lt;/p&gt;</description></item><item><title>Access Database Field in JScript</title><link>https://www.infopathdev.com:443/forums/thread/34527.aspx</link><pubDate>Wed, 19 Nov 2008 21:11:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34527</guid><dc:creator>AliMalek</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34527.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=34527</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am new to Infopath. So far, I designed a form to list contacts and it works. Now, I need to be able to delete a table row using the follwoing code.&amp;nbsp;&amp;nbsp;SQLComplexDBID is the primary key but probably I have wrong syntax here because I am getting error after clicking on delete button. I checked the query in SQL profiler and it is delete dbo.SQLComplexDB where SQLComplexDBID = . Meaning that the primary key is not added to the query and executed.&lt;/p&gt;
&lt;p&gt;Can you please help? I attached my form.&lt;/p&gt;
&lt;p&gt;function btnDelete::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{ var SQLComplexDBID = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:SQLComplexDBList[@SQLComplexDBID]&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Command = &amp;quot;delete dbo.SQLComplexDB where SQLComplexDBID = &amp;quot; + SQLComplexDBID; &lt;/p&gt;
&lt;p&gt;XDocument.Query(); } &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;
&lt;p&gt;Ali&lt;/p&gt;</description></item></channel></rss>