Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi there!

 

i have a little problem...

 

The membership class: where should i store a user's first name and last name?

 

i thought of storing it in the user profile, but there is a problem:

lets say the admin wants to see all the users in his site in a gridview,

and to see the property "IsUserLocked" (aspnet_users table), together with the user's first name (which is stored in the aspnet_profile table).

 

its not the same table... and with the structure of aspnet_profile u cant do a "SELECT" statement....

what can i do then?

 

thank you for your help.

Posted

I'm not 100% sure I understand what your asking, but I'll give it a shot. If you have user information stored in two, or more different tables, then you can perform a query on the database that joins the information together and displays it as one record. Barring you have a common indentifier in each table that will link the two together. Using your example....

 

select
   t1.UserId,
   t1.Permission
   t2.IsUserLocked
from
   aspnet_profile t1,
   aspnet_users t2
where
   (t1.UserId = t2.UserId)

"In the immortal words of Socrates, who said "' I drank what?!'"
Posted

Unfortunately

 

Unfortunately, aspnet_profile isn't built that way.

 

its built with a string column of XML data and another binary column that both hold the entire propreties for a single user... in one row identified by UserId, u cant seperate those properties ( for example UserFirstName) by an ordinary SELECT statement (OR IS THERE A WAY?)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...