我想檢查用戶名是否已經存在。這是我已經達到的,但它不工作。如何在signUp時檢查已存在的用戶名
Dim cmdstr As String = "Select count(*) from Registration where username = '" & txtName.Text & "'"
Dim userExist As SqlCommand = New SqlCommand(cmdstr, con)
Dim temp As Integer = Convert.ToInt32(userExist.ExecuteScalar().ToString())
If (temp = 1) Then
Response.Write("user name is already Exist!!")
End If
** SQL INJECTION **,去查找它。什麼是錯誤或爲什麼「不起作用」? –
它不會給我的信息 – Hassan