Ok This is my situation, I am trying to bind a ListView with data(my user's username) calling from my SProc, so each user photo of the ListView has a link to a profile page with query-string of their username attached. I realised that I may be able to do a join with the dbo.aspnet_Users to get their username, but is this advisable?
I understand we should use the membership API but I can't think of a way not to get data from the aspnetdb database. Is there a more appropriate way of doing this? Thanks.
Yes, there is no harm in querying aspnet_Users
or any other Microsoft Membership database table under normal circumstances.
But if you are dealing with fairly large number of records, it will effect the query performance. The reason behind it is that, INDEXING applied on Microsoft Membership tables is not very ideal. Most of the tables have ApplicationId
as clustered index, which no one uses even rarely.
UserId
is indexed, and LoweredUserName
field is indexed in aspnet_membership
and aspnet_users
tables. So use them in your where clauses to boost up performance for large databases.
I hope this answers your question, if yes then mark it as "answered".