如何检查sql表中是否存在Name [英] How to check whether Name exists in sql table or not

查看:76
本文介绍了如何检查sql表中是否存在Name的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,





我有文本框txtincidentnumber。如果我点击按钮我想显示事件编号是否存在于db它会在javascript function.Plz中显示警告消息。

Hai,


I have textbox "txtincidentnumber".If i click button i want to show if the incident number exists in db it will show alert message in javascript function.Plz any idea for this.

推荐答案

你没有正确标记你的问题。如果您使用的是SQL Server,请参阅:创建重复记录,如果已经存在的记录显示消息框asp.net [ ^ ]
You have not tagged your question properly. If you are using SQL Server then see this : create the duplicate record, if allready existing record show the message box asp.net[^]


我不知道这是webforms还是MVC网站制造。但是,如果是MVC,



创建一个接收事件编号的动作,然后连接到您的数据库并进行检查。

此操作可以通过AJAX方法调用,如果成功返回结果,则可以显示相应的消息。
I have no idea if this is a webforms or a MVC site you are making. However if it is MVC,

Create an action that receives an incident number and then connects to your database and checks.
This action could be called by an AJAX method and then if successful return the results so you can display the appropriate message.


这篇关于如何检查sql表中是否存在Name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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