Simple Iterator

  • Thread starter Thread starter Martin Schmid
  • Start date Start date
M

Martin Schmid

I have a dataset that contains view... i.e., the structure is like this:
[char(9), date,char(255)]

Using ado.net in C#, how to I create an 'iterator' on this table to read the
first row, next row, etc.. until I reach the last row.
 
How do I get the data from the column named <columnName> in the 'row'?



--
Thanks,
Martin Schmid, EIT, CCSA, MCDBA, MCSE
Miha Markic said:
Hi Martin,

foreach (DataRow row in dataset.Tables["tablename"].Rows)
...

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Martin Schmid said:
I have a dataset that contains view... i.e., the structure is like this:
[char(9), date,char(255)]

Using ado.net in C#, how to I create an 'iterator' on this table to read the
first row, next row, etc.. until I reach the last row.
 
Hi Martin,

object data = row["columnName"];
There are also overloads which return different version of data (current,
original, etc)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Martin Schmid said:
How do I get the data from the column named <columnName> in the 'row'?



--
Thanks,
Martin Schmid, EIT, CCSA, MCDBA, MCSE
Miha Markic said:
Hi Martin,

foreach (DataRow row in dataset.Tables["tablename"].Rows)
...

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Martin Schmid said:
I have a dataset that contains view... i.e., the structure is like this:
[char(9), date,char(255)]

Using ado.net in C#, how to I create an 'iterator' on this table to
read
the
first row, next row, etc.. until I reach the last row.
 
Back
Top