Read XML file from ADO (VB6) Into .Net DataSet
- by Jimbo
I am trying to assist users in migrating from a VB6 application to a C# application.
The VB6 app allows the export of data from an ADO (2.8) recordset via XML, but the C# application fails to read the XML producing the following error:
System.Data.DuplicateNameException: A column named 'name' already belongs to this DataTable
VB6 Code
Dim RS As Recordset
Set RS = p_CN.Execute("SELECT * FROM tblSuppliers INNER JOIN tblSupplierGroups ON tblSupplierGroups.SupplierGroupID=tblSuppliers.SupplierGroupID")
RS.Save sDestinationFile, adPersistXML
Set RS = Nothing
C# Code
DataSet ds = new DataSet();
ds.ReadXml(xmlFilePath);
I have obviously incorrectly assumed that the XML file format was universally understood?