SqlException错误代码

编程入门 行业动态 更新时间:2024-10-09 19:14:07
本文介绍了SqlException错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个问题,这不是问题.我的数据库有一些限制,如唯一名称(存储必须唯一的名称的列)插入或更新时,数据库将验证我们是否未覆盖某些名称,如果是,则返回可转换为SqlException的错误,代码为2627

I have a question, and it is not a problem. My database have some restrictions, as unique names (Column that stores the name of something that must be unique) When inserting or updating, the db verifies if we are not overriding some name, and if so, returns an error that is convertable to SqlException with code 2627

我的问题是...如果存在某些表格或我可以参考的东西以指示最终用户做什么?

My Question is... if exists some table or something that I can consult to indicate to the final user what to do?

在这种情况下..存在一个具有相同名称的用户....

In this case.. that exists a user with the same name....

推荐答案

我认为,您应该看看SqlExceptions 错误属性,并查看错误编号,应将您指向master.dbo.sysmessages表中的消息.

I think, you should take a look at SqlExceptions Errors property and take a look at errors number which should point you to a message in master.dbo.sysmessages table.

更多推荐

SqlException错误代码

本文发布于:2023-11-28 03:46:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640827.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误代码   SqlException

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!