public class classTransaction
{
private SqlTransaction st;
public bool errorOccured;
Public SqlTransaction beginTransaction(SqlConnection con)
{
try
{
st = con.BeginTransaction();
errorOccured = false;
return st;
}
catch
{
return null;
}
}
public bool endTransaction(SqlTransaction st)
{
bool done;
if (!errorOccured)
{
st.Commit();
done = true;
}
else
{
st.Rollback();
done = false;
}
return done;
}
}


