I too am having the same problem. I have a web service that has been created allowing me to insert to SQL 2005 database. However, I am only able to insert the first row of a repeating section. I was hoping Qdabra would be the solution, but the documenation only really discusses the sample ExpenseReport Is it possible to use a different form?
If not, here is a copy of the WebService I am using for the insert statement... this is very simplified version of what I am trying accomplish... (for testing purposes only)
The infopath form is a single repeating section with two fields [txtAppName] & [intAppType]
Here is the sample Web Service I am using... again it only inserts 1 row regardless of how many repeating sections I have...
<%@ WebService language="VB" class="TestClass" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Public Class TestClass
<WebMethod> Public Function Add(a As Integer, b As Integer) As Integer
Return a + b
End Function
<WebMethod> Function InsertApplication(ByVal appName As String, ByVal appType As Integer) As System.Data.Dataset
Dim connectionString As String = "server='server1\application'; trusted_connection=true; database='Application"& _
"Type"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "INSERT INTO [tblApplication] ([AppName], [AppType]) VALUES (@AppName, @AppType)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_appName As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_appName.ParameterName = "@AppName"
dbParam_appName.Value = appName
dbParam_appName.DbType = System.Data.DbType.[String]
dbCommand.Parameters.Add(dbParam_appName)
Dim dbParam_appType As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_appType.ParameterName = "@AppType"
dbParam_appType.Value = appType
dbParam_appType.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_appType)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
End Function
End Class