Ok. I Export two tables in XML using writeXML and i want to update another database with the same table schema with these XML tables.
Below is the Update code and Exported XML i am trying to use.
So far No Luck. where am i going wrong?
Code:
VB Code:
Private Sub updateFromXML() Dim dsXMLImport As New DataSet Dim cmdAdapter As New OleDbCommand myConn = New OleDbConnection(strAccessConn) Try myConn.Open() cmdAdapter.Connection = myConn Dim da1 As New OleDbDataAdapter() Dim da2 As New OleDbDataAdapter() dsXMLImport.ReadXml(Me.tbFilePath.Text) 'For Table 1 da1.SelectCommand = cmdAdapter da1.InsertCommand.Parameters.Add(dsXMLImport.Tables(0)) da1.Fill(dsXMLImport) da1.Update(dsXMLImport) 'For Table 2 da2.SelectCommand = cmdAdapter da2.InsertCommand.Parameters.Add(dsXMLImport.Tables(1)) da2.Fill(dsXMLImport) da2.Update(dsXMLImport) Catch ex As Exception Finally myConn.Close() cmdAdapter.Dispose() End Try End Sub




Reply With Quote