View Single Post
  #3  
Old 01-28-2021, 08:09 AM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,921

Unfortunately I don't know much VB. Any reason you decided to go with VB instead of something like c#?

I think selecting the entire user database and looping through it is going to be a problem if you have many users. I also don't see if you're assigning a unique userid that isn't the username/email to the profile.

You're query could look something like this:
Code:
SELECT * FROM users WHERE username='new username' AND userid != 'current userid'
If that query comes back positive, the username requested is already assigned to another user.

For whatever reason, the comparison operators in VB don't compute in my head but I think the username compare line needs to be something like this:
Code:
If datareader(1).ToString = txtUsername.Text And Not My.Settings.Username = datareader(1).ToString Then
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote