views:

96

answers:

1

Hi,

We just came across a weird bug in our application that uses the asp.net membership.

The administrator had created some users with spaces behind their name: 'My Username ' In the Users table this is saved normally, so without the spaces: 'My Username' The user can also login using the name without the spaces: 'My Username' When we use User.Identity.Name in our applicatie the result is the username WITH the spaces: 'My Username '.

Where do these spaces come from? They aren't stored in the Users table so where does he get this from?!

Thanks!

+2  A: 

How are you determining that it isn't stored in the DB with the space at the end? Are you sure the SSMS isn't just hiding it from you?

Noon Silk
I'm not 100% sure, but I see these spaces in our own tables when I edit the field, but not when I do this in the users table.
SaphuA
This is almost guaranteed. The spaces are in the DB, you just can't see them. http://support.microsoft.com/kb/316626
Nix
@SaphuA: What is the type of the field in your own tables?
Noon Silk