将数据错误记录到表中。 [英] Logging data error to a table.

查看:70
本文介绍了将数据错误记录到表中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将数据错误记录到MSSQL中的表中。例如,如果电子邮件ID与模式不匹配,则需要登录到例外表。请给我最好的方法来解决这个问题。



我尝试过:



需要知道最好的方法。

I need to log data error to a table in MSSQL. For example if email id is not matching a pattern, need to log to an exception table. Please give me best possible way to solve this issue.

What I have tried:

Need to know about the best possible ways to do it.

推荐答案

没有最好的方法来做这件事。但是,我建议您实现第三方日志工具,例如log4Net,或者只编写自己的代码。



我更喜欢编写自己的代码。创建一个可以将异常传递给的类,并将错误写入数据库表。这很简单。
There is no such thing as "best" way to do it. However, I suggest you either implement a 3rd party logging tool like log4Net, for example, or just write your own code.

I prefer to write my own code. Create a class that you can pass exceptions to and have it write the error to a database table. It's pretty straightforward.


这篇关于将数据错误记录到表中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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