Developed in .Net 4.0 (vb.net).
I'm thinking of using the DataTable.Merge method to combine the two DataTable.
dataTableA.Merge(dataTableB, false, MissingSchemaAction.Error)
If so,
Cannot find definition of column XXX in target table B.
and errors.
Although this may appear to be a simple error, column XXX exists in both dataTableA and dataTableB.
dataTableA.WriteXmlSchema("schemaA.xml")
dataTableB.WriteXmlSchema("schemaB.xml")
The XML of the schema output as also matches.
The error message table name (B) and DataTable.TableName match dataTableB.
dataTableB.Columns.Contains("XXX")
returns True
.
Is there anything else you might have overlooked?
There were few similar coding areas, so I decided to use ImportRow in the loop to deal with it.
ImportRow also needs to match the schema, so I don't understand why it works...
var result=dataTableA.AsEnumerable().Union(dataTableB.AsEnumerable()) .CopyToDataTable();
Sorry, I'm not very good at Japanese.
© 2024 OneMinuteCode. All rights reserved.