You're looking at the wrong function. The FindUsersByName is not meant to
get a user. It's meant to find a number of users that are similar to the
username entered. The stored procedure behind this uses LIKE instead of =,
this means you could say bob% and get all usernames that begin with bob.
What you want, instead is the GetUser. Best way to see if a user exists is
to just try a call to GetUser and if it returns null, then there is no user.
If it returns a MembershipUser object that isn't null, then you have a user.
--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:ek**************@TK2MSFTNGP04.phx.gbl...
Can anyone tell me why FindUsersByName() returns a collection? Isn't it
necessary that user names are unique (how else would passwords be
validated?)
And what is the best way to determine if a user name is already in use?
Preferrably, I could do this without raising an exception--I just want to
know whether or not they exist.
Thanks!
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com