0

Greetings guys can you help me with this one,

i want to validate if the username is already taken or not yet but i don't have a clue on how to do it.

i tried this code

dtCustomer.Rows.Count > 0

but it didn't work @_@.. please guys i really need help thanks in advance :D.

2
Contributors
2
Replies
11
Views
4 Years
Discussion Span
Last Post by Aven.Seven
1

Easiest way is to wuery the database as in

SELECT COUNT(*) WHERE Username = 'joeblow'

If the returned value is 0 then the username is available. I suggest you use parameters to create the query string. How you do that depends on whether you are using OleDB or SqlClient. You can find examples of both here

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.