企业库的自定义包装器 [英] Custom Wrapper for enterprise library

查看:69
本文介绍了企业库的自定义包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我需要使用Enterprise库在SQL Server 2005中记录异常.

现在我的查询是:
1.我将从不同的地方(而不是从web.config)获得连接字符串.所以我想我需要写一个包装类来进行连接.您能提出实现方法和类的详细信息吗?
2.其他查询是,在一个示例中,我正在catch代码块中使用以下代码行将异常记录到db中.

Hello all,


I need to use Enterprise library for exception logging in SQL Server 2005.

Now my queries here are that:
1. I would be getting the connection string from different place [not from web.config]. So i guess i need to write a wrapper class for connection. Can you suggest implementation way and the class details for it.
2. Other query is that, in one example i am using following line of code in catch block to log exception in db.

bool s = ExceptionPolicy.HandleException(ex, "CustomException");


这是正确的方法吗?我有更好的选择吗?
3.如果我想更改数据库表结构和用于记录日志的存储过程,该怎么办?我是否需要通过覆盖企业库的现有类来创建包装器类?

请提出建议.


Is this correct way? Do i have any better alternative for it??
3. If i want to change database table structure and stored procedure for logging what should i do? Do i need to create wrapper classes by overriding the existing class of Enterprise library?

Please suggest.

推荐答案

也许这会帮助分层异常使用企业库处理 [^ ]
Maybe this will help Hierarchical Exception Handling with the Enterprise Library[^]


这篇关于企业库的自定义包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆