views:

1221

answers:

1

Hi, does anyone know the best way to insert a column in a datatable at position 0?

+5  A: 

use the following code to add col to datatable

    DataColumn Col   = datatable.Columns.Add("Column Name", System.Type.GetType("System.Boolean"));
    Col.SetOrdinal(0);// to put the column in position 0;
Wael Dalloul