日期:2014-05-20 浏览次数:20977 次
static void Main(string[] args)
{
DataTable dt1 = GetTable();
DataTable dt2 = GetTable();
int listCount = 10000;
Random random = new Random();
for (int i = 1; i <= listCount; i++)
{
DataRow row = dt1.NewRow();
row["Warehouse"] = "100" + random.Next(2).ToString();
row["storage"] = "100" + random.Next(3).ToString();
row["MaterialCode"] = i.ToString();
row["Qty"] = random.Next(10);
row["WayQty"] = 10;
//row["WayQty"] = random.Next(1);
dt1.Rows.Add(row);
}
Random random1 = new Random();
for (int i = 1; i <= listCount; i++)
{
DataRow row = dt2.NewRow();
row["Warehouse"] = "100" + random1.Next(2).ToString();
row["storage"] = "100" + random1.Next(3).ToString();
row["MaterialCode"] = i.ToString();
row["Qty"] = random1.Next(10);
row["WayQty"] = 10;
//row["WayQty"] = random1.Next(1);
dt2.Rows.Add(row);
}
//Linq的测试方式
Stopwatch linq_Stopwatch = new Stopwatch();