当前位置:   article > 正文

.net中的错误机制 try… catch …_.net trycatch汇总

.net trycatch汇总

 try
{

}

 catch (System.Data.SqlClient.SqlException ex)
 {
     if (ex.Number == 547)
     {
           MessageBox.Show("该记录存在关联","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
           return false;
    }

  if (ex.Number == 2627)
   {
           throw ex;
   }

}catch (Exception ex)
{

}
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号