摘要: create proc sp_Testasbegin begin transaction begin try--sql语句省略end trybegin catch if(@@TRANCOUNT >0)insert into tb_error (Message)values(ERROR_MESSAGE())--这句永远不会执行 有谁知道请留意rollback transaction end catchif(@@TRANCOUNT >0)commit transaction 阅读全文
posted @ 2011-12-19 17:18 放哨De老鼠 阅读(220) 评论(0) 推荐(0)
摘要: .netframework2.0、3.5中的用法using System.Threading;Thread td= new Thread(new ThreadStart(run));//只传递方法名称、不能带参数private void run() {//方法体}.netframework4.0中可以这样使用using System.Threading.Tasks;Task task= new Task(() => run(0));//可以带参数Task.WaitAll(task);//可以判断等所有线程执行完在执行别的任务private void run(int num) {//方法体 阅读全文
posted @ 2011-12-19 08:54 放哨De老鼠 阅读(369) 评论(0) 推荐(0)