[导入]sqlhelper 使用事务实例

string myConnectString = "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer;Connect Timeout=30";
SqlConnection myConnection = new SqlConnection(myConnectString);
myConnection.Open();
SqlTransaction st = myConnection .BeginTransaction();
try
{
...
SqlHelper.ExecuteDataset(st,...);
SqlHelper.ExecuteDataset(st,...);
...
st.Commit();
}
catch(SqlException ee)
{
st.Rollback();
throw ee;
}


文章来源:http://www.blog.edu.cn/user2/34558/archives/2005/1041287.shtml
posted on 2005-12-16 16:22  MOZO  阅读(1330)  评论(1)    收藏  举报