Last post Dec 13, 2012 09:13 PM by Decker Dong - MSFT
Dec 13, 2012 06:10 AM|szewciu|LINK
How can I get with C# logged in UserID to insert it into other database table?
Columns in second table has the same datatype (uniqueidentifier) as column UserId in aspnet_Membership table.
It doesn't work for me if I try to put value of Guid variable type and string:
public MembershipUser mojObiekt = Membership.GetUser();
string userID = myObject.ProviderUserKey.ToString(); Guid userkGuid = new Guid(userID);
and convert function to uniqueidentifier in SQL query also doesn't work.
Dec 13, 2012 06:16 AM|oned_gk|LINK
Dec 13, 2012 09:13 PM|decker dong - msft|LINK
string userID =user.identity.name
Nice, but notice that C# is case sensitive;), so:
string userID = User.Identity.Name;