<?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: Help Submiting Multiple Rows from Infopath to SQl Server 2008 via Sql-endpoint webservice using table-valued parameters</title><link>https://www.infopathdev.com:443/forums/thread/60663.aspx</link><pubDate>Mon, 25 Oct 2010 07:31:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60663</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60663.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=60663</wfw:commentRss><description>&lt;p&gt;Hi Daniloraf,&lt;/p&gt;
&lt;p&gt;Qdabra Software funds this free forum. We guarantee that we will respond to 90% of all posts. It takes a tremendous amount of time to do that, but we are committed to helping people. To help defray some of the cost of running the forum and responding to users, Qdabra sells a couple very inexpensive tools - like qRules and DBXL. DBXL allows you to connect your InfoPath forms to a database. No code required and you get a data-driven web service that can be used for all of your form templates. &lt;/p&gt;
&lt;p&gt;Direct SQL data connections are problematic because schemas change and they don&amp;#39;t work for browser based forms. SQL endpoints are problematic due to bugs in Microsoft&amp;#39;s implementation. Sorry I don&amp;#39;t have more details.&lt;/p&gt;
&lt;p&gt;Our stance is to help people. After helping many people solve problems, we develop solutions and suggest people use those because they will save time and money. The solutions aren&amp;#39;t offered to make us a lot of money. They just help us defray the cost of the forum and they help you because they are fast, flexible, and follow best practices.&lt;/p&gt;</description></item><item><title>Help Submiting Multiple Rows from Infopath to SQl Server 2008 via Sql-endpoint webservice using table-valued parameters</title><link>https://www.infopathdev.com:443/forums/thread/60432.aspx</link><pubDate>Sat, 16 Oct 2010 02:56:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60432</guid><dc:creator>daniloraf</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60432.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=60432</wfw:commentRss><description>Help Submiting Multiple Rows from Infopath to SQl Server 2008 via Sql-endpoint webservice using table-valued parameters
&lt;br /&gt;
&lt;br /&gt;
Background
&lt;br /&gt;
I´m trying to submit an infopath(2007) form (an invoice) to sql server 2008. Form will be hosted on Infopath Forms Services (moss2007). There are many submit actions upon clicking the submit control (the button on the form), and one of them must submit a repeating table to a sqlserver endpoint webservice that uses table-valued parameters to insert the rows to a database table.
&lt;br /&gt;
&lt;br /&gt;
Problem
&lt;br /&gt;
My current solution works, but only for the first row of the repeating table, and, of course, all rows must be submited. 
&lt;br /&gt;
-------------
&lt;br /&gt;
The form:
&lt;br /&gt;
The Main Data Source was created by me and has many other fields other than the repeating table. The repeating table itself has 5 columns. The Submit button on the form triggers several submit actions. One of these actions must submit the repeating table to a soap webservice (that is a sqlserver native endpoint, for those not familiar with it, it is native functionality that calls a stored procedure as a webmethod.. at least that is what i am doing)
&lt;br /&gt;
--------------
&lt;br /&gt;
The webservice (native sql server 2008 endpoint)
&lt;br /&gt;
It is a standard template i found on the internet. it calls the 
&lt;br /&gt;
&lt;br /&gt;
CREATE ENDPOINT insertdetails
&lt;br /&gt;
STATE = STARTED
&lt;br /&gt;
AS HTTP (
  PATH =&amp;#39;/SQL/insertdetails&amp;#39;,
  AUTHENTICATION=(integrated),
  PORTS=(clear)
)
&lt;br /&gt;
FOR SOAP (
  WEBMETHOD &amp;#39;insertsproc&amp;#39;
  (
    NAME=&amp;#39;databasename.dbo.insertsproc&amp;#39;,
    SCHEMA=standard,
    FORMAT=rowsets_only),
    WSDL=default,
    BATCHES=enabled,
    LOGIN_TYPE=windows
)
&lt;br /&gt;
&lt;br /&gt;
-------------------------
&lt;br /&gt;
SQL Stored Procedures and Table-Valued Parameters (There are two sprocs)
&lt;br /&gt;
insertsproc: exposed to webservice, to get data from the infopath form, and send it to a sql server table-valued type.
&lt;br /&gt;
&lt;br /&gt;
USE [databasename]
&lt;br /&gt;GO
&lt;br /&gt;SET ANSI_NULLS ON
&lt;br /&gt;GO
&lt;br /&gt;SET QUOTED_IDENTIFIER ON
&lt;br /&gt;GO
&lt;br /&gt;ALTER PROCEDURE [dbo].[insertsproc] 
&lt;br /&gt;	@idor			int,
&lt;br /&gt;	@idprodent		int,
&lt;br /&gt;	@qtde			int,
&lt;br /&gt;	@compr			decimal (18,2),
&lt;br /&gt;	@tipoesttransac		varchar (50)
&lt;br /&gt;AS
&lt;br /&gt;BEGIN
&lt;br /&gt;SET NOCOUNT ON;
&lt;br /&gt;DECLARE @table AS tabletype3
&lt;br /&gt;INSERT INTO @table (idor, idprodent, qtde, compr, tipoesttransac)
&lt;br /&gt;VALUES (@idor, @idprodent, @qtde, @compr, @tipoesttransac)
&lt;br /&gt;EXECUTE submit2
&lt;br /&gt;@details = @table
&lt;br /&gt;SELECT * FROM @table
&lt;br /&gt;END
&lt;br /&gt;GO
&lt;br /&gt;
&lt;br /&gt;
Note that this sproc executes the next one (even tough they are created in reverse order than the one shown here)
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;USE [databasename]
&lt;br /&gt;GO
&lt;br /&gt;SET ANSI_NULLS ON
&lt;br /&gt;GO
&lt;br /&gt;SET QUOTED_IDENTIFIER ON
&lt;br /&gt;GO
&lt;br /&gt;ALTER PROCEDURE [dbo].[submit2] 
&lt;br /&gt;	(@details dbo.tabletype3 READONLY)
&lt;br /&gt;AS
&lt;br /&gt;BEGIN
&lt;br /&gt;	SET NOCOUNT ON;
&lt;br /&gt;INSERT INTO dbo.test2 (idor, idprodent, qtde, compr, tipoesttransac)
&lt;br /&gt;		SELECT idor, idprodent, qtde, compr, tipoesttransac FROM @details
&lt;br /&gt;END
&lt;br /&gt;
&lt;br /&gt;
-------------------------
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;and this is the table type creation query:
&lt;br /&gt;
&lt;br /&gt;CREATE TYPE tabletype3 AS TABLE
&lt;br /&gt;( 
&lt;br /&gt;[idor] [int] NULL,
&lt;br /&gt;[idprodent] [int] NULL,
&lt;br /&gt;[qtde] [int] NULL, 
&lt;br /&gt;[compr] [decimal] (18,2) NULL, 
&lt;br /&gt;[tipoesttransac] [varchar] (50) NULL
&lt;br /&gt;)
&lt;br /&gt;GO
&lt;br /&gt;
&lt;br /&gt;
--------------------------
&lt;br /&gt;
&lt;br /&gt;
It works, but only for the first row of the repeating table.
&lt;br /&gt;
Form -&amp;gt; form connection -&amp;gt; endpoint webservice -&amp;gt; sproc-1 -&amp;gt; sproc-2 -&amp;gt; table
&lt;br /&gt;
Where is the error? And how can I fix it?
&lt;br /&gt;
&lt;br /&gt;
--------------------------
&lt;br /&gt;Limitations:
&lt;br /&gt;1) i do not wish to use the parse xml approach, unless absolutely extremely necessary.
&lt;br /&gt;2) i do not wish to use those sql xml datatypes, since i do not know how they work, and would like to stick to the current approach.
&lt;br /&gt;3)I do not use visual studio, since i am not a programmer.
&lt;br /&gt;4)I do not wish to use an IIS webservice, since i do not know how to program it properly (at least without study).
&lt;br /&gt;
&lt;br /&gt;
Thank you!</description></item></channel></rss>