mycommand.transaction = mytrans;
try
{
da.update(ds);
mycommand.transaction.commit();
console.writeline("update successful.");
}
catch(exception e)
{
try
{
mytrans.rollback();
}
catch (sqlexception ex)
{
if (mytrans.connection != null)
{
console.writeline("an exception of type " + ex.gettype() +
" was encountered while attempting to roll back the transaction.");
}