using System.Transactions;
try
{
using (TransactionScope scope = new TransactionScope())
{
var count = dc.ExecuteCommand(@"insert into bg_count_month(tj_month,emp_id,emp_name,count_month,count_day,money,dw)
select tj_month,emp_id,emp_name,count_month,count_day,money,dw from bg_count_month_import");
Lable_message.Text = "导入记录数:" + count;
dc.ExecuteCommand("delete from bg_count_month_import ");
scope.Complete();
}
GridView2.DataSourceID = "SqlDataSource1";
GridView2.DataBind();
Response.Write(MyUI.javascript_alert(Lable_message.Text));
}
catch (Exception e1)
{
Lable_message.Text = e1.Message;
Response.Write(MyUI.javascript_alert("错误:导入数据错误!"));
}