private void simpleButton1_Click(object sender, EventArgs e) { DateTime time = System.DateTime.Now; DataTable table = creatData(); if (TradeInfoService.AddTradeInfoSqlBulkCopy(table) == ReturnType.Success) { XtraMessageBox.Show("success!"); } DateTime time1 = System.DateTime.Now; MessageBox.Show("I am not cache & use time:" + (time1 - time).ToString()); }
private void importIn_Click(object sender, EventArgs e) { DataTable table = new DataTable("TradeInfo"); table.Columns.Add("TradeInfoCode", typeof(string)); table.Columns.Add("CustomTid", typeof(string)); table.Columns.Add("Title", typeof(string)); table.Columns.Add("Content", typeof(string)); table.Columns.Add("AppendUserCode", typeof(string)); table.Columns.Add("AppendUserName", typeof(string)); table.Columns.Add("AppendDepartment", typeof(string)); table.Columns.Add("time", typeof(string)); table = ExecleDs("D:\\a.xls"); TradeInfoService.AddTradeInfoSqlBulkCopy(table); if (TradeInfoService.AddTradeInfoSqlBulkCopy(table) == ReturnType.Success) { XtraMessageBox.Show("success!"); } }