문제

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.

도움이 되었습니까?

해결책

just convert the column in the other table to a string and insert the uniqueidentifier as a string in the other table.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top