MembershipProvider Get user Uniqekey

MembershipProvider Get user Uniqekey
To avoid dead locks using membership provider,

read this post http://omaralzabir.com/optimize_asp_net_membership_stored_procedures_for_greater_speed_and_scalability/


Some times we require to get the user unique key. Below code will get the user unique key from DB.

 
MembershipUser u = Membership.GetUser("UserName");

String Uniquekey = (u.ProviderUserKey);

Web.config membership section

  <membership defaultProvider="xyzMembershipProvider">
   <providers>
    <clear/>
    <add name="xyzMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider"
                                     applicationName="/myApp"
                                     connectionStringName="aspnetdbConnectionString"/>
   </providers>
</membership>

 

Tags:

ASp.net 2.0 step by step Membership Provider Linq get max value from listListBox Asp.net Binding csharpJquery Get Target Of EventMemberShip Count Online UsersGetfilename GetExtensionC# Online usersHow to get Jquery selected optionHow are you using session variables in Asp.net with C#.netC# ArrayList Search using Linq Extension OfType MethodC#.net Get Yesterday.

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.