使用微软企业库-异常处理
2008-08-17 14:37
218 查看
using System;
//
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
/// <summary>
///使用微软企业库-异常处理
/// </summary>
public class EnterpriseException
{
public void AddDept(string name)
{
try
{
//
}
catch (Exception ex)
{
bool reThrow = ExceptionPolicy.HandleException(ex, "Data Access Policy");
if (reThrow)
{
throw;
}
}
}
}
//
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
/// <summary>
///使用微软企业库-异常处理
/// </summary>
public class EnterpriseException
{
public void AddDept(string name)
{
try
{
//
}
catch (Exception ex)
{
bool reThrow = ExceptionPolicy.HandleException(ex, "Data Access Policy");
if (reThrow)
{
throw;
}
}
}
}
相关文章推荐
- asp.net 事务的处理,dts 的设置,asp.net三种事务处理方法,三层架构,微软企业库,动软生成器生成的代码下如何使用事务
- 微软企业库EntLib5.0使用过程中常见的异常
- 使用微软企业库5.0进行WCF服务边界上的异常保护
- 【译】使用微软企业库5.0进行WCF服务边界上的异常保护
- 微软企业库异常处理-WrapHandler
- 微软企业库异常处理-ReplaceHandler
- 微软企业库5.0学习笔记(四十二)异常处理模块
- 微软企业库异常处理-CustomHandler
- C中的goto,setjmp使用示例(异常的集中处理)
- SQL2005中异常处理消息框可直接使用
- 使用Spring MVC统一异常处理实战
- 在使用SSH过程中,在JSP页面中对数据进行处理,出异常!
- 学习笔记附录:动软代码生成器和微软企业库的使用
- 使用Spring MVC统一异常处理实战
- PHP5的异常处理机制[8]--使用throw关键字
- [EntLib]微软企业库5.0 学习之路——第二步、使用VS2010+Data Access模块建立多数据库项目
- [EntLib]微软企业库5.0 学习之路——第十步、使用Unity解耦你的系统—PART2——了解Unity的使用方法(1)
- C语言实现异常处理(使用 setjmp 和 longjmp 函数)
- 使用微软企业库5.0提供的unity配置解藕系统demo(源码)
- 如何使用Spring优雅地处理REST异常