Re: read ADO adPersistXml recordset into ADO.NET Dataset?
From: Teemu Keiski (joteke_at_aspalliance.com)
Date: 11/23/04
- Next message: Ken Varn: "Re: Need explanation on calling Close() from finalizer."
- Previous message: Sushil Chordia: "Re: SQL Server and unicode"
- In reply to: arvee: "read ADO adPersistXml recordset into ADO.NET Dataset?"
- Messages sorted by: [ date ] [ thread ]
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!!! > >
- Next message: Ken Varn: "Re: Need explanation on calling Close() from finalizer."
- Previous message: Sushil Chordia: "Re: SQL Server and unicode"
- In reply to: arvee: "read ADO adPersistXml recordset into ADO.NET Dataset?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|