Looping through data adapter

  • Thread starter Thread starter John
  • Start date Start date
J

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
 
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!
*************************************************
 
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.
__________________________________
 
Back
Top