![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#11
| |||
| |||
|
|
how would I do that? "Mohamad Elarabi [MCPD]" <MohamadElarabiMCPD (AT) discussions (DOT) microsoft.com wrote Not if you indexed the PhotoUser column. -- Mohamad Elarabi MCP, MCTS, MCPD. "Tem" wrote: Thanks If I understand this correctly PhotoUser would store the username of the user the photo belongs to. Wouldn't this be slow performance wise? (searching a string) would it be faster to use UserID uniqueidentifier instead? "Phil H" <google (AT) philphall (DOT) me.uk> wrote in message news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com... On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote: Im making a photo gallery application where users can only see their own photos. My photos table looks like this Id, PhotoName, PhotoURL, PhotoUser I need to know how I can integrate this with ASP.NET's membership provider Can someone points me to the right direction Thanks Tem I'm not sure what you mean by "integrate" but the requirement you describe could be met by filtering the data table on Membership username (if that differs from PhotoUser then add an extra column) which is easily read with the Membership.getuser() function. |
#12
| |||
| |||
|
|
This is what I don't understand How would it know, who the photo belongs to if there wasn't an identifier field (PhotoUser) in the Photo table? |
#13
| |||
| |||
|
|
On 29 Dec, 20:44, "Tem" <tem1... (AT) yahoo (DOT) com> wrote: This is what I don't understand How would it know, who the photo belongs to if there wasn't an identifier field (PhotoUser) in the Photo table? I don't know whether I made it clear but I suggested that the "username" (or user id) that users log in with could be used as a unique identifier in the photo table. To achieve this a column would have to be created to contain it, and the identity added to the table as part of the process of creating user accounts with the Membership object. It does in effect mean that two databases are being used along- side each other - the photo database and the membership one but without a lot of extra coding to create a custom membership provider it is unavoidable. |
#14
| |||
| |||
|
|
I would agree with this approach as well. If your photos are unique to each user..than sure Table dbo.Photo PhotoUUID UserID ( FK to the membershp...UserID (guid) PhotoName --(etc, add others columns if necessary) that would work. Then you can write your own usp (user stored procedure) to get a photo list for a specific UserID But YOU have to roll this code. Aka, the filtering. You can use and piggy back off of the UserId (guid) as the uniqueidentifier for each user...but what I was getting at is that the Membership/Role providers aren't going to magically do this for you. create proc dbo.uspPhotoListGetByUserId ( @UserId uniqueidentifier ) as Select PhotoUUID , UserId, PhotoName, (etc , etc) From dbo.Photo ph where ph.UserId = @UserId Go You'll be able to know the UserId from the membership stuff..but you'll have to create and call uspPhotoListGetByUserId when needed. "Phil H" <google (AT) philphall (DOT) me.uk> wrote in message news:717495e1-8af9-451a-934c-a90963a69d9e (AT) i72g2000hsd (DOT) googlegroups.com... On 29 Dec, 20:44, "Tem" <tem1... (AT) yahoo (DOT) com> wrote: This is what I don't understand How would it know, who the photo belongs to if there wasn't an identifier field (PhotoUser) in the Photo table? I don't know whether I made it clear but I suggested that the "username" (or user id) that users log in with could be used as a unique identifier in the photo table. To achieve this a column would have to be created to contain it, and the identity added to the table as part of the process of creating user accounts with the Membership object. It does in effect mean that two databases are being used along- side each other - the photo database and the membership one but without a lot of extra coding to create a custom membership provider it is unavoidable. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |