private void save_db(){
SqlConnection conn = new SqlConnection(ConfigurationSettings
SqlCommand comm = new SqlCommand();
conn
SqlTransaction rollbk
comm
comm
try
{
for(i){
comm
comm
}
rollbk
}
catch(Exception exp)
{
rollbk
Response
return;
}
finally
{
conn
}
Response
}
From:http://tw.wingwit.com/Article/program/net/201311/13944.html