日期:2014-05-17 浏览次数:20773 次
private static DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("学号", typeof(Int32));
dt.Columns.Add("姓名", typeof(string));
dt.Columns.Add("年龄", typeof(Int32));
DataRow dr = null;
dr = dt.NewRow();
dr["学号"] = 1;
dr["姓名"] = "张三峰";
dr["年龄"] = 13;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["学号"] = 2;
dr["姓名"] = "无常";
dr["年龄"] = 12;
dt.Rows.Add(dr);