You need to check it via a query like:
SELECT COUNT(*) FROM MyTable WHERE UserName = @CheckUserName
If the count returned from the database is greater than zero then it means that the username is already taken.
Call DB using the query and implement the flow based on the result retrieved. Try!