Re: read ADO adPersistXml recordset into ADO.NET Dataset?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Teemu Keiski (joteke_at_aspalliance.com)
Date: 11/23/04


Date: Tue, 23 Nov 2004 23:09:32 +0200

Hi,

Have you tried this way

1. create also ADO Recordset instance in ADO.NET using COM
2. Load the XML into Recordset
3. Create OleDbDataAdapter and DataSet instances
4 Fill DataSet with the ADO Recordset with the help of OleDbDataAdapter.

Detailed explanation:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconfillingdatasetwithadorecordset.asp

-- 
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsider
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"arvee" <nospam@spam.not> wrote in message
news:kTvod.4504$K36.3761@trndny03...
> 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!!!
>
>


Relevant Pages

  • Re: Is there any use for XML in VB (or anywhere else) ?
    ... an ADO recordset. ... It really depends on the data structure that you are trying to ... I just prefer the flexibility of the XML ... Linux web servers. ...
    (microsoft.public.vb.general.discussion)
  • RE: ADO Recordset to Excel 2007 Worksheet Cell Values via XML
    ... I've now saved a sample ADO recordset in ADO recordset XML format and ... opened that .XML file with Excel. ... Excel created a schema and opened a new workbook. ...
    (microsoft.public.excel.programming)
  • Re: XML error
    ... I believe ADO recordset uses XML parser to load data. ... My program builds an XML string from an ADO ... > ' Write the contents of the textbox into the Stream. ...
    (microsoft.public.data.ado)
  • Re: SQLXML Performance question
    ... What version of ADO do you use? ... Do you use server or client side FOR XML? ... way than using a ADO recordset as described above? ...
    (microsoft.public.sqlserver.xml)
  • Re: VB6 - Saving query results as XML
    ... following fruit: ... However if I want the results as XML I could use ... Jan Hyde ... So if I have a variable RS returned as an ADO recordset I can save that as XML? ...
    (microsoft.public.vb.general.discussion)