Monday, January 31, 2005

Auto Increment Column In DataTable

DataColumn objDataColumn = new DataColumn();
objDataColumn.ColumnName = "AutoColumn";
objDataColumn.AutoIncrement = true;
objDataColumn.AutoIncrementSeed = 1;
objDataColumn.AutoIncrementStep = 1;

objDataTable.Columns.Add(objDataColumn);

2 comments:

Hammad said...

This is how you can create a DataColumn that has an auto-increment column!

Chamaeleon Chimera said...

lol, I don't understand this GEEk language, can't say much about your work, although sounds good :P Geez, but thanks for the comment :)