将SQL Server错误显示到网页 [英] Display SQL Server Errors to web page

查看:88
本文介绍了将SQL Server错误显示到网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在我的网页上显示错误消息
从sql服务器中的error_message()方法返回的结果.

Hi,,
I want to display the error message on my web page
that return from error_message() method in sql server.

推荐答案

您将要专门捕获SQL异常,而不是通用的Exception.

You''ll want to catch the SQL exception specifically, instead of the generic Exception.

catch (SqlException sqlEx)


这篇关于将SQL Server错误显示到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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