Method 1:
datatable tbldatas = new datatable (" datas ");
datacolumn Dc = NULL;
Dc = tbldatas. columns. add ("ID", type. getType ("system. int32 ");
DC. autoincrement = true; // automatically add
DC. autoincrementseed = 1; // start value: 1
DC. autoincrementstep = 1; // The step size is 1
DC. allowdbnull = false; //
Dc = tbldatas. columns. add ("product", type. getType ("system. string ");
Dc = tbldatas. columns. add ("version", type. getType ("system. string ");
Dc = tbldatas. columns. add ("Description", type. getType ("system. string ");
datarow newrow;
newrow = tbldatas. newrow ();
newrow ["product"] = "fruit knife";
newrow [" version "] =" 2.0 ";
newrow [" Description "] =" Fight dedicated ";
tbldatas. rows. add (newrow);
Newrow = tbldatas. newrow ();
Newrow ["product"] = "folding stool ";
Newrow ["version"] = "3.0 ";
Newrow ["Description"] = "one of the seven weapons in jianghu ";
Tbldatas. Rows. Add (newrow );
Method 2:
datatable tbldatas = new datatable (" datas ");
tbldatas. columns. add ("ID", type. getType ("system. int32 ");
tbldatas. columns [0]. autoincrement = true;
tbldatas. columns [0]. autoincrementseed = 1;
tbldatas. columns [0]. autoincrementstep = 1;
tbldatas. columns. add ("product", type. getType ("system. string ");
tbldatas. columns. add ("version", type. getType ("system. string ");
tbldatas. columns. add ("Description", type. getType ("system. string ");
Tbldatas. Rows. Add (new object [] {null, "A", "B", "C "});
Tbldatas. Rows. Add (new object [] {null, "A", "B", "C "});
Tbldatas. Rows. Add (new object [] {null, "A", "B", "C "});
Tbldatas. Rows. Add (new object [] {null, "A", "B", "C "});
Tbldatas. Rows. Add (new object [] {null, "A", "B", "C "});