Read XML file from ADO (VB6) Into .Net DataSet

Posted by Jimbo on Stack Overflow See other posts from Stack Overflow or by Jimbo
Published on 2010-05-29T12:36:48Z Indexed on 2010/05/29 12:42 UTC
Read the original article Hit count: 455

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml