There's an issue I'm having in several areas of my ASP.NET site, but am using the following as an example. If I can get it solved, then I'm reasonably sure it has applications elsewhere.Let's say I have a gridview based on the aspnet_membership table. Its LINQ datasource is aspnet_membership, which exists in my datacontext.By itself, it works GREAT in the grid.However, showing UserId in and of itself doesn't have much meaning; I wanted to include UserName.So, in my Public Partial Class, I created a read-only property UserName: Public ReadOnly Property UserName() As String
Dim db As New MyDataContext
Dim User As aspnet_User = db.aspnet_Users.Single(Function(p) p.UserId = UserId)
End PropertyThis retrieves and displays the correct data, no problem there.However, I'm not able to sort on that new column. When I attempt to do so, I get the following error:The member 'aspnet_Membership.UserName' has no supported translation to
SQL.A workaround is, of course, to use a Sql datasource. But as I'm learning more about LINQ and the partial classes, I want to learn how to do it the correct way.
View Complete Post