views:

21

answers:

0

I have two tables:

AspnetUsers

Userid uniqueidentifier NOT Null PK UserName Nvarchar (256) NOT Null More column More Column

UserProfiles

UserId uniqueidentifier Not null PK FK Default (newid()) Username Nvarchar(256) Not Null More columns, More More columns

There is a constraint between the 2 tables. When a user is insterted into the Aspnetusers table, I want the userName inserted into the UserProfiles Table. When a user logs in, I want them to be able to update their info. So I want the filter to load only their information so they can update it. I know I will have to set the Where Clause in Entity Datasource to userid = @UserId to filter by the username. So I did this in my Code behind Page

CodeBehind

Protected Sub EntityDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.EntityDataSourceSelectingEventArgs) Handles EntityDataSource1.Selecting ' Get a reference to the currently logged on user Dim currentUser As MembershipUser = Membership.GetUser()

    ' Determine the currently logged on user's UserId value
    Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid)
    ' Assign the currently logged on user's UserId to the @UserId parameter

I AM LOST FROM HERE. WHAT DO I DO HERE??? End Sub

I am using ENTITYDATASOURCE, ASP.NET and VB Visual Studio 2010 and ASP.NET membership, SQL 2008.

My Entity DS looks like this