RE: getting Membership userid to use and store in a custom databas



Sorry,
I accually know how to convert it to VB now

Dim UserInfo as MembershipUser

Finally understand all this :)

Tdar

"TdarTdar" wrote:

> I would like to use the key in a many to one database the (one being your
> memebership database, many being favorate items for that user) for there
> custom home page. In order to accomplish this I would need the userid
> (unique key) that i can populate as a relationship between the two SQL
> tables. And I would need to query for that information in that table after
> words.
>
> Tdar
>
> "Steven Cheng[MSFT]" wrote:
>
> > Hi Tdar,
> >
> > Welcome to ASPNET newsgroup.
> > Regarding on the getting Membership userid question, do you mean how to
> > access the underlying MembershipUser's identity value(primary key)? Based
> > on my understanding, we can get the MembershipUser's underlying database
> > identity through the following code:
> >
> > ================
> > protected void Page_Load(object sender, EventArgs e)
> > {
> > MembershipUser user = Membership.GetUser();
> >
> > Response.Write("<br>Username: " + user.UserName);
> > Response.Write("<br>:LastLoginDate " + user.LastLoginDate);
> > Response.Write("<br>ProviderUserKey: " +
> > user.ProviderUserKey.ToString());
> > }
> > ================
> >
> > the above code help display the current login user's ProviderUserKey.
> > However, the "ProviderUserKey contains the underlying user key identity
> > which is provider specific(generally it should be transparent to
> > developers...). So we do not recommend that we directly use it in our
> > asp.net web application. Also, for FormsAuthentication, the authentication
> > ticket is cookie based, and I think the authentication ticket only
> > contains username as the identity rather than the underlying UserKey.
> > Is there any particular scenario in your application that you need to use
> > the underlying Provider specific UserKey value? Please feel free to post
> > here if you have anything unclear.
> >
> > Thanks,
> >
> > Steven Cheng
> > Microsoft Online Support
> >
> > Get Secure! www.microsoft.com/security
> > (This posting is provided "AS IS", with no warranties, and confers no
> > rights.)
> >
> >
> >
> >
> >
> > --------------------
> > | Thread-Topic: getting Membership userid to use and store in a custom
> > database
> > | thread-index: AcXiO0UBc5CrmfpOQsuTIEeMy9+g4Q==
> > | X-WBNR-Posting-Host: 24.73.223.27
> > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <Tdar@xxxxxxxxxxxxxx>
> > | Subject: getting Membership userid to use and store in a custom database
> > | Date: Sat, 5 Nov 2005 11:01:03 -0800
> > | Lines: 13
> > | Message-ID: <E58FF96B-6338-46C8-8F9F-388A6BAF2262@xxxxxxxxxxxxx>
> > | MIME-Version: 1.0
> > | Content-Type: text/plain;
> > | charset="Utf-8"
> > | Content-Transfer-Encoding: 7bit
> > | X-Newsreader: Microsoft CDO for Windows 2000
> > | Content-Class: urn:content-classes:message
> > | Importance: normal
> > | Priority: normal
> > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
> > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> > | Xref: TK2MSFTNGXA01.phx.gbl
> > microsoft.public.dotnet.framework.aspnet.webcontrols:11708
> > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
> > |
> > | Hello,
> > | What is the code to retrive the userid of the currently loged in user
> > | from the asp)user membership databse using the new login controls of
> > | asp.net 2.
> > |
> > | How do i use that in the "configure database source. What is the source
> > | would it be profile or from the cookie, and if it is profile what would
> > be in
> > | teh propery name?
> > |
> > |
> > | Tdar
> > |
> > |
> > |
> >
> >
.



Relevant Pages

  • Re: marian, have a heavy farmer. You wont wind it
    ... Try not to cry a membership! ... increasing hammers fetch as well as the increased molecule. ... but will Ibraheem inform that? ... Many rolls will be underlying ...
    (sci.crypt)
  • Re: Replacing VS .NETs SQL Server Express Edition Integration
    ... As you said you already have an existing database that contains the ... membership structure, ... Replacing VS .NET's SQL Server Express Edition Integration ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Seen the Survey?
    ... paper appointment records and census returns for leaders ... I'm looking at it in many ways from someone that knows such a database ... Membership Database that I perceive no real use for nor need for. ... The task is to work with kids and get them active, ...
    (uk.rec.scouting)
  • Re: Need to load 200 users into Form security DB
    ... membership provider" if you want to see what that entails. ... My situation is that I had a development database with some users/roles ... security database in SQL2008 with 11 tables, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What do you think about......?
    ... just posting a message on one of the Yahoo groups I moderate and I ... One thing I thought of was putting the Directory in a database. ... it could be accessed by anyone with membership to the group. ... I'm not sure if you can limit access to a feature of a group while all ...
    (rec.crafts.textiles.quilting)