I have a web service that executes a SQL stored procedure. The stored procedure executes and fills a dataset. How do I get the dataset into an InfoPath repeating list ? Here is the code I have now.
<WebMethod(Description:="Retrieves the list of roles for a given userID.")> _
Public Function GetUserRoles(ByVal sUserID As String) As XmlNode
Dim oConnection As New SqlConnection
Dim oDataset As New DataSet
oConnection.ConnectionString = g_sCONN_STRING
Try
Dim oCommand As New SqlCommand("dbo.usp_MOCSVCS_selUserRoles", oConnection)
Dim parameter As SqlParameter
Dim oDataAdatpter As SqlDataAdapter
oCommand.CommandType = CommandType.StoredProcedure
oCommand.Connection.Open()
'Add parameters to oCommand object
parameter = oCommand.Parameters.Add("@sUserID", SqlDbType.NChar)
'Set parameter value
oCommand.Parameters("@sUserID").Value = sUserID
' Create the DataAdapter & DataSet
oDataAdatpter = New SqlDataAdapter(oCommand)
' Fill the DataSet using default values for DataTable names, etc
oDataAdatpter.Fill(oDataset)
Catch ex As Exception
'Return ex.Message
Finally
oConnection.Close()
End Try
Return DataSetToXmlNode(oDataset)