read ADO adPersistXml recordset into ADO.NET Dataset?

A

arvee

I have an older application that provides a table in the old ADO
disconnected recordset format. For example:

- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
- <s:AttributeType name="ContactName" rs:number="1" rs:nullable="true"
rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="30" />
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
- <rs:data>
<z:row ContactName="Maria Anders" />
<z:row ContactName="Ana Trujillo" />
<z:row ContactName="Antonio Moreno" />
<z:row ContactName="Thomas Hardy" />
<z:row ContactName="Christina Berglund" />
</rs:data>
</xml>

I'd like to read this XML into a new application using .NET into an ADO.NET
Dataset complete w/ the schema. I've tried:

DataSet myDS = new DataSet();
myDS.ReadXml(@"c:\junk\adopersist.xml", XmlReadMode.Auto);

but it comes in as two separate tables. Is there a way to do read the XML
and retain the schema?

Thanks!!!
 
W

William \(Bill\) Vaughn

ADO classic and ADO.NET use different types of XML to persist/read rowsets.
I wrote an article on this some time ago.
See www.betav.com/articles.htm.


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top