Code
//声明一个名称为default的datatable
DataTable dt = new DataTable("default");
//声明int类型的列id
DataColumn dc = new DataColumn("id", typeof(int));
//为Datatable增加一列
dt.Columns.Add(dc);
//声明int类型的列title
dc = new DataColumn("title", typeof(string));
//为Datatable增加一列
dt.Columns.Add(dc);
//声明int类型的列content
dc = new DataColumn("content", typeof(string));
//为Datatable增加一列
dt.Columns.Add(dc);
dc.AutoIncrement = true;
//为Datatable增加一行
DataRow dr = dt.NewRow();
dr["id"] = 1;
dr["title"] = "hao";
dr["content"] = "content";
dt.Rows.Add(dr);
//为Datatable增加一行
dr = dt.NewRow();
dr["id"] = 1;
dr["title"] = "hao";
dr["content"] = "content";
dt.Rows.Add(dr);
//声明一个名称为default的datatable
DataTable dt = new DataTable("default");
//声明int类型的列id
DataColumn dc = new DataColumn("id", typeof(int));
//为Datatable增加一列
dt.Columns.Add(dc);
//声明int类型的列title
dc = new DataColumn("title", typeof(string));
//为Datatable增加一列
dt.Columns.Add(dc);
//声明int类型的列content
dc = new DataColumn("content", typeof(string));
//为Datatable增加一列
dt.Columns.Add(dc);
dc.AutoIncrement = true;
//为Datatable增加一行
DataRow dr = dt.NewRow();
dr["id"] = 1;
dr["title"] = "hao";
dr["content"] = "content";
dt.Rows.Add(dr);
//为Datatable增加一行
dr = dt.NewRow();
dr["id"] = 1;
dr["title"] = "hao";
dr["content"] = "content";
dt.Rows.Add(dr);