如何检查用户是否存在于数据库中 [英] How to check the User exist or not in DB
本文介绍了如何检查用户是否存在于数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助我有关如何检查用户是否存在于数据库中.
谢谢,
Narasima
Hi,
Please help me regarding this How to check the user exists or not in DB.
Thanks,
Narasima
推荐答案
购买基本的SQL书籍并阅读.然后转到涵盖ADO.NET的书,这样您就知道如何将查询结果输入代码中.
如果我愿意,我无法提供完整的代码来复制和粘贴,因为我不知道您的数据库架构.
Buy a basic book on SQL and read it. Then move on to a book that covers ADO.NET so you know how to get the result of your query into your code.
I couldn''t give you full code to copy and paste if I wanted to, as I don''t know your database schema.
在用户名的帮助下很简单,只需检查您要新建的用户名是否已经存在.
例如,选择用户名表格tblel,其中username =''newusername'';
如果将返回某个值,则表明该用户已经存在,否则不存在.
simple with the help of username, just check the username which u want to new is allready exists or not.
e.g select username form tblel where username=''newusername'';
if this will return some value means user already exists, otherwise not.
这篇关于如何检查用户是否存在于数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文