asp.net 注册 判断用户名是否存在

来源:百度知道 编辑:UC知道 时间:2024/09/23 14:33:07
注册时输入一个用户名,判断它已经是否存在.
我是用常用的方法,不要用AJAX的方法.
请给出代码.解决问题的加30分.

sql="select * from iymm where username='" &usernamea &"'"
rs.open sql,db,3,2
if not rs.eof then
response.write "<script>window.alert('您欲注册的昵称已经存在');history.back(-1);</script>"
response.end
end if

否则下面就把注册信息写入数据库