C# – How to loop through the values of a particular column in datatable

cdatarowdatatablenet

I want to loop through the values of a particular column in datatable? can anyone please give the C# coding?

Best Answer

DataTable tbl = new DataTable();
foreach (DataRow row in tbl.Rows)
{
    object cellData = row["colName"];
}