|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Bug adding identity column to an existing DataTableHi all,
I'm trying to add a kind of "identity" column into an existing DataTable of a DataSet: I'm using this code but the new column doesn't fill as expected with an incremented value. Any idea ? DataSet ds = ... .... DataColumn identity = new DataColumn( "ROWINDEX", typeof(int) ); identity.AutoIncrement = true; identity.AutoIncrementSeed = 0; identity.AutoIncrementStep = 1; ds.Tables[0].Columns.Add( identity ); When I inspect the value in the ROWINDEX column of each row, it looks random and the same value appears in different rows !! Any idea ? |
|||||||||||||||||||||||