create a c# datatable object with GUID as identifier?
c#, datatable
Solution
Certainly, check here:
http://msdn.microsoft.com/en-us/library/system.data.datatable.primarykey(VS.71).aspx
// Create a new DataTable and set two DataColumn objects as primary keys.
DataTable myTable = new DataTable();
DataColumn[] keys = new DataColumn[1];
DataColumn myColumn = new DataColumn();
myColumn.DataType = System.Type.GetType("System.Guid");
myColumn.ColumnName= "ID";
// Add the column to the DataTable.Columns collection.
myTable.Columns.Add(myColumn);
keys[0] = myColumn;
// Set the PrimaryKeys property to the array.
myTable.PrimaryKey = keys;
Problem
is this possible instead of an incrementing ID number, I have GUID in the code instead?