.NET?????????????????????????
???????????? ???????[ 2015/4/15 11:00:11 ] ????????.NET ???????
???????Log4net???????????????????40000??????β???1??????????????????System.Diagnostics.StopWatch????????????β?????????????
??????????????£?
public delegate bool InsertHandler(DataTable table?? int batchSize);
public partial class FrmBatch : Form
{
private Stopwatch _watch = new Stopwatch();
public FrmBatch()
{
InitializeComponent();
}
private void FrmBatch_Load(object sender?? EventArgs e)
{
txtRecordCount.Text = "40000";
txtBatchSize.Text = "1";
}
//???????????
private void btnInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteInsert?? "Use SqlServer Insert");
}
//???sql??????
private void btnBatchInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteBatchInsert?? "Use SqlServer Batch Insert");
}
//???sql??????Transaction
private void btnTransactionInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteTransactionInsert?? "Use SqlServer Batch Transaction Insert");
}
//???sql??????SqlTransaction
private void btnSqlTransactionInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteSqlTransactionInsert?? "Use SqlServer Batch SqlTransaction Insert");
}
//???DataAdapter
private void btnDataAdapterInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteDataAdapterInsert?? "Use SqlServer DataAdapter Insert");
}
//???TransactionScope
private void btnTransactionScopeInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteTransactionScopeInsert?? "Use SqlServer TransactionScope Insert");
}
//?????????
private void btnTableTypeInsert_Click(object sender?? EventArgs e)
{
Insert(DbOperation.ExecuteTableTypeInsert?? "Use SqlServer TableType Insert");
}
private DataTable InitDataTable()
{
DataTable table = Tools.MakeDataTable();
int count = 0;
if (int.TryParse(txtRecordCount.Text.Trim()?? out count))
{
Tools.MakeData(table?? count);
//MessageBox.Show("Data Init OK");
}
return table;
}
public void Insert(InsertHandler handler?? string msg)
{
DataTable table = InitDataTable();
if (table == null)
{
MessageBox.Show("DataTable is null");
return;
}
int recordCount = table.Rows.Count;
if (recordCount <= 0)
{
MessageBox.Show("No Data");
return;
}
int batchSize = 0;
int.TryParse(txtBatchSize.Text.Trim()?? out batchSize);
if (batchSize <= 0)
{
MessageBox.Show("batchSize <= 0");
return;
}
bool result = false;
_watch.Reset(); _watch.Start();
result = handler(table?? batchSize);
_watch.Stop(www.nuoya66.com);
string log = string.Format("{0};RecordCount:{1};BatchSize:{2};Time:{3};"?? msg?? recordCount?? batchSize?? _watch.ElapsedMilliseconds);
LogHelper.Info(log);
MessageBox.Show(result.ToString());
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
?????????????????(java .net ?????).Net?й???????????Asp.net MVC??ζ???????????????????????Trim????Asp.Net WebForm????????????.Net??????????С????asp.net ???????????.Net??????????????????Linux???Jexus?й?Asp.Net Core??ó???asp.net??????????????ASP.NET???????JSON?????????????????? .NET ?? Java ???? IT ???.Net??Ч???????????????ù???ASP.NET MVC???????????Щ?£?.NET???????????????????????.net???????????????Asp.net Core MVC?????Session
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????