Home All Groups Group Topic Archive Search About

How to use ADO recordset format in ADO.NET?

Author
14 Nov 2005 10:36 AM
Sylvain COADOU
Hello
I'm working on an ASP.NET webapp and I must fill a datagrid with some old
ADO recordset format XML files (made with Save command in vb6) which is not
(fully) compatible with ADO.NET.
Do you a trick to allow this?

Sylvain

Author
14 Nov 2005 2:00 PM
Cowboy (Gregory A. Beamer)
You will either have to:

1. Use interop, with ADO
2. Consume as XML
3. Transform the XML into the ADO.NET format

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
Show quote
"Sylvain COADOU" <sylvaincoa***@abplusconseil.fr> wrote in message
news:437868a4$0$553$626a14ce@news.free.fr...
> Hello
> I'm working on an ASP.NET webapp and I must fill a datagrid with some old
> ADO recordset format XML files (made with Save command in vb6) which is
> not (fully) compatible with ADO.NET.
> Do you a trick to allow this?
>
> Sylvain
>
Author
14 Nov 2005 2:16 PM
Kerry Moorman
Sylvain,

From Help:

"To provide access from ADO.NET to ADO Recordset and Record objects, the
..NET Framework Data Provider for OLE DB overloads the Fill method of the
OleDbDataAdapter to accept an ADO Recordset or Record object."

There is more detailed info in Help, under DataTable class, accessing ADO
Recordset or Record.

Kerry Moorman



Show quote
"Sylvain COADOU" wrote:

> Hello
> I'm working on an ASP.NET webapp and I must fill a datagrid with some old
> ADO recordset format XML files (made with Save command in vb6) which is not
> (fully) compatible with ADO.NET.
> Do you a trick to allow this?
>
> Sylvain
>
>
>
Author
14 Nov 2005 2:39 PM
S.M. Altaf [MVP]
I'm not totally familiar with ADO in ASP.NET pages, but you mentioned that
you have XML files.  What about using Dataset.ReadXML()?
-Altaf
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com


Show quote
"Sylvain COADOU" <sylvaincoa***@abplusconseil.fr> wrote in message
news:437868a4$0$553$626a14ce@news.free.fr...
> Hello
> I'm working on an ASP.NET webapp and I must fill a datagrid with some old
> ADO recordset format XML files (made with Save command in vb6) which is
> not (fully) compatible with ADO.NET.
> Do you a trick to allow this?
>
> Sylvain
>
Author
14 Nov 2005 3:32 PM
Cor Ligthert [MVP]
Sylvian,

I assume that your XML file is a self build XML file.

That means that you can read that file using the XMLTextreader.

See this sample (The XML is in the sample)

http://www.vb-tips.com/default.aspx?ID=e788c048-e547-4de3-9c6a-22589f018cd4

Than you can set that item by item in a datatable, which you can use as a
datasource for your datagrid.

To create an empty datatable it is

dim dt as new datatable
dt.columns.add(mycolumn1,gettype(system.String))'or other types in VB helps
intelligence for that.
etc. for all columns

Filling a datatable while you are reading is probably nothing more than
creating the fields and than

dt.loaddatarow(new object() {field1,field2,field3},true)

and than setting this to your datagrid

datagrid1.datasource = dt
datagrid1.databind

I hope this helps,

Cor



Show quote
"Sylvain COADOU" <sylvaincoa***@abplusconseil.fr> schreef in bericht
news:437868a4$0$553$626a14ce@news.free.fr...
> Hello
> I'm working on an ASP.NET webapp and I must fill a datagrid with some old
> ADO recordset format XML files (made with Save command in vb6) which is
> not (fully) compatible with ADO.NET.
> Do you a trick to allow this?
>
> Sylvain
>

AddThis Social Bookmark Button