Following code will create a studentID column that allow null values in this column for rows that belong to the this table.


DataColumn newcolumn=new DataColumn("studentID", System.Type.GetType("System.Int32"));
newcolumn.AllowDBNull = true;
//// Add column to datatable.
DataTable mytable=new DataTable();
mytable.Columns.Add(column);

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/N0LLlGPiW7s/14591