#region createTable
private DataTable createTable(int colCount,int rowCount)
{
DataTable table = new DataTable();
table.TableName = "示例表";
for (int i = 0; i < colCount; i++)
{
DataColumn col = new DataColumn();
col.Caption = "列" + i.ToString();
col.ColumnName = "列" + i.ToString();
table.Columns.Add(col);
}
for (int j = 0; j < rowCount; j++)
{
DataRow row = table.NewRow();
for (int i = 0; i < colCount; i++)
{
row[i] = "行" +j.ToString() + ",列" + i.ToString();
}
table.Rows.Add(row);
}
return table;
}
#endregion
private DataSet creatDataSet()
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add( new DataColumn("ID", typeof(int)));
dt.Columns.Add(new DataColumn("vc_Code", typeof(string)));
dt.Columns.Add(new DataColumn("vc_Name", typeof(string)));
dt.Columns.Add(new DataColumn("vc_Memo", typeof(string)));
dt.Columns.Add(new DataColumn("i_Flag", typeof(int)));
dt.Rows.Add("1","1","1","1","1");
dt.Rows.Add("2", "2", "2", "2", "2");
dt.Rows.Add("3", "3", "3", "3", "3");
ds.Tables.Add(dt);
return ds;
}