显示数据库表中的错误消息 [英] displaying error msgs from database table

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

问题描述

我的项目需要将所有异常存储在数据库表中,并且每个MSG都有唯一的ID.
当数据库表发生异常时,我需要显示它们

任何人都可以给我一个想法怎么做

谢谢inadvance

Hi,my project need all the exception to be stored in database table with a unique id for each MSG.
i need to display them when exception occur from database table

can any one give me an idea how to do that

thanks inadvance

推荐答案

好吧,对于"异常处理",我不认为这是一个好的编程方法.

作为一名程序员,应该能够识别出特定的代码可以抛出什么类型的异常.然后基于此,应在Catch块中处理相应的异常.另外,除了所有预期的异常之外,您还可以将System.Exception作为默认/支持的异常.

无论如何,您都可以参考下面的链接以获取并非全部列表,而是许多常见的.Net异常列表.

http://mikevallotton.wordpress.com/2009/07/08/net -exceptions-all-of-them/

http://www.developerfusion.com/article/1889/exception-handling-in -c/3/
Well I dont believe that''s a Good Programming aproach when it comes to "Exception Handling".

As a programmer one should be able to identify what all Types of Exceptions can be thrown by perticular code. And then based on that corresponding Exceptions should be handled in Catch Block. Also you can have System.Exception as a default/supporting Exception in addition to all your Expected Exceptions.

Any ways, you may refer below links for list of not ALL but many common .Net Exceptions.

http://mikevallotton.wordpress.com/2009/07/08/net-exceptions-all-of-them/

http://www.developerfusion.com/article/1889/exception-handling-in-c/3/


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

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