Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

InfoPath - Programmatically Copy Data from Secondary Data Connection into Main Data Connection

$
0
0

I am having trouble copying data from my secondary data connection into my main data connections repeating table, below is my code for adding an item to my main data connections repeating table:

Private Sub AddItem( _
    ByVal Car As String)

        Dim doc As XmlDocument = New XmlDocument()
        Dim group As XmlNode = doc.CreateElement("CurrentBodiesSnapShot", _
        NamespaceManager.LookupNamespace("d"))

        Dim field As XmlNode = doc.CreateElement("Car_ID", _
        NamespaceManager.LookupNamespace("@"))
        Dim node As XmlNode = group.AppendChild(field)
        node.InnerText = Car

        doc.AppendChild(group)

        MainDataSource.CreateNavigator().SelectSingleNode( _
        "/dfs:myFields/dfs:dataFields", _
        NamespaceManager).AppendChild(doc.DocumentElement.CreateNavigator())

    End Sub

I get this message when I enter debugging mode "Schema validation found non-data type errors", it highlights this line when it pops up:

MainDataSource.CreateNavigator().SelectSingleNode( _"/dfs:myFields/dfs:dataFields", _
    NamespaceManager).AppendChild(doc.DocumentElement.CreateNavigator())

Its the first time I've had this message and do not know how to get around it, and I think its with the "/dfs:myFields/dfs:dataFields" code, if anyone could provide any assistance I would greatly appreciate it :)

Thanks in advance!



Viewing all articles
Browse latest Browse all 2257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>