Add number column autoincrement in datatable
To the existing DATATABLE, I want to add identity column as "TaxNo"=> 1,2,3,4,5.....Using below code" but I could see new column added without values... Values not getting appending.. Why..
DataColumn dcAutoNumber = new DataColumn("TaxNo",typeof(int));
dcAutoNumber.AutoIncrement = true;
dcAutoNumber.AutoIncrementStep = 1;
dcAutoNumber.AutoIncrementSeed=1;
dcAutoNumber.ColumnName = "TaxNo";
dtTaxiDetails.Columns.Add(dcAutoNumber);
dtTaxiDetails.PrimaryKey = new DataColumn[] { dtTaxiDetails.Columns["id"] };