I tried very hard to understand how it works but I still can´t write de correct code.
Lets see...
I changed two things...
var user = db.QuerySingle("SELECT
UserId, DisplayName, Bio FROM UserProfiles WHERE UserId = @0",
WebSecurity.CurrentUserId);
var galleries = db.Query(@"SELECT from Galleries.Id, Galleries.Name, where UserId = user, COUNT(Photos.Id) AS PhotoCount FROM Galleries, LEFT OUTER JOIN Photos ON Galleries.Id = Photos.GalleryId GROUP BY Galleries.Id, Galleries.Name").ToList(); }
The error is in the var galleries because the "var user" is ok.
[ Token line number = 2,Token line offset = 62,Token in error = user ]
What I need is to select just the photos that each member uploaded. In the original template any member can see all the photos and I need to change to a personal gallery, which just who uploaded the photo can see it.
mclazarini
Member
63 Points
57 Posts
Re: Photo Gallery - User ID
Apr 13, 2012 07:37 PM|LINK
I tried very hard to understand how it works but I still can´t write de correct code.
Lets see...
I changed two things...
var user = db.QuerySingle("SELECT UserId, DisplayName, Bio FROM UserProfiles WHERE UserId = @0", WebSecurity.CurrentUserId);
var galleries = db.Query(@"SELECT from Galleries.Id, Galleries.Name, where UserId = user, COUNT(Photos.Id) AS PhotoCount FROM Galleries, LEFT OUTER JOIN Photos ON Galleries.Id = Photos.GalleryId GROUP BY Galleries.Id, Galleries.Name").ToList(); }
The error is in the var galleries because the "var user" is ok.
[ Token line number = 2,Token line offset = 62,Token in error = user ]
What I need is to select just the photos that each member uploaded. In the original template any member can see all the photos and I need to change to a personal gallery, which just who uploaded the photo can see it.
The error
Thanks a lot,
Mclazarini