loop through columns

How can I get a values that I entered into column through dataset? I have a column with User names. I would like to loop through that names to find a specific name.

1 Reply

AD Administrator Syncfusion Team May 13, 2005 01:21 PM UTC

If you want to loop directly though the datatable, you loop through the datatable1.Rows collection that contains DataRow objects. given a DataRow, dr, you get a particular column value by indexing it with teh column name.
for(int i = 0; i < dt.Rows.Count; ++i)
{
   DataRow dr = dt.Rows[i];
   string val = dr["ColumnName"].ToString();
}

Loader.
Up arrow icon