1.利用线程处理
2 设置执行响应时间
public void dowork()
{
lock (obj)
{
Thread thread = new Thread(new System.Threading.ThreadStart(InsertTicketWork));
thread.Start();
}
}
public void InsertTicketWork()
{
Database db = DatabaseFactory.CreateDatabase();
using (DbCommand cmd = db.GetStoredProcCommand("proc_ticketChange", ticketParm))
{
//响应时间
cmd.CommandTimeout = 600;
db.ExecuteNonQuery(cmd);
//判断程序是否执行出错
this.ErrorMessage = cmd.Parameters[cmd.Parameters.Count - 1].Value as string;
if (this.ErrorMessage == null) this.ErrorMessage = string.Empty;
}
}