Google+

Wednesday, May 4, 2011

DataTable.Columns Property

The following example prints each value of each row in a table using the Columns property.



private void PrintValues(DataTable table)
{
    foreach(DataRow row in table.Rows)
    {
        foreach(DataColumn column in table.Columns)
        {
            Console.WriteLine(row[column]);
        }
    }
}


Note:-Please comment and reply me.

1 comment: