Home All Groups Group Topic Archive Search About

Looping through data adapter

Author
28 Aug 2006 4:11 PM
John
Hi

I have a data adapter bound to a table. How can I loop through the table via
and access each record's column values on the way?

Thanks

Regards

Author
28 Aug 2006 4:26 PM
Cowboy (Gregory A. Beamer)
What kind of table are you binding to? If it is a standard .NET control,
everyone I know has a Data bind method of some sort where you can query
values as the form is loaded.

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

*************************************************
Think outside of the box!
*************************************************
Show quoteHide quote
"John" <John@nospam.infovis.co.uk> wrote in message
news:%233nDxyryGHA.3428@TK2MSFTNGP02.phx.gbl...
> Hi
>
> I have a data adapter bound to a table. How can I loop through the table
> via and access each record's column values on the way?
>
> Thanks
>
> Regards
>
>
Author
28 Aug 2006 4:28 PM
William (Bill) Vaughn
A "data adapter" can't really be bound to anything. You can bind to the
DataSet populated by a DataAdapter or bind to the underlying DataTables.
The DataTable object can be addressed by iterating through the Rows
collection as in

    For each dr as DataRow in myDataSet.Tables("MyTableName").Rows

    Next
The individual columns are referenced through the DataRow Item "property"
which can be addressed by name or ordinal (number).

I suggest picking up any one of the dozens of books on ADO.NET. Even my
(relatively old) ADO and ADO.NET Examples and Best Practices discusses these
basics.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
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.
__________________________________

Show quoteHide quote
"John" <John@nospam.infovis.co.uk> wrote in message
news:%233nDxyryGHA.3428@TK2MSFTNGP02.phx.gbl...
> Hi
>
> I have a data adapter bound to a table. How can I loop through the table
> via and access each record's column values on the way?
>
> Thanks
>
> Regards
>
>
Author
28 Aug 2006 4:35 PM
Cor Ligthert [MVP]
John,

Do you read replies to these newsgroups?

http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/msg/df51c13d3e6742c1

Now Bill is using time to write in another way the same as I did.

Cor


Show quoteHide quote
"John" <John@nospam.infovis.co.uk> schreef in bericht
news:%233nDxyryGHA.3428@TK2MSFTNGP02.phx.gbl...
> Hi
>
> I have a data adapter bound to a table. How can I loop through the table
> via and access each record's column values on the way?
>
> Thanks
>
> Regards
>
>