ADO.NET最佳实践(中)[11]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 spidertan 的 blog

  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.");

      }

本文关键:数据库设计
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top