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

InfoPath Dev

Use our Google Custom Search for best site search results.

Programmatically Copy Data from Secondary Data Connection into Main Data Connection

Last post 01-09-2014 07:26 AM by hayer89. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-09-2014 07:26 AM

    Programmatically Copy Data from Secondary Data Connection into Main Data Connection

    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!

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.