簡體   English   中英

獲取並插入其他表UserId

[英]Getting and inserting into other table UserId

如何使用登錄用戶ID的C# 將其插入其他數據庫表中

第二個表中的列與aspnet_Membership表中的UserId列具有相同的數據類型( uniqueidentifier )。

如果我嘗試輸入Guid變量類型和字符串的值,這對我不起作用:

(...)    
public MembershipUser mojObiekt = Membership.GetUser();
(...)
string userID = myObject.ProviderUserKey.ToString();
Guid userkGuid = new Guid(userID);

並將函數轉換為SQL查詢中的uniqueidentifier也不起作用。

只需將另一個表中的列轉換為字符串,然后將uniqueidentifier作為字符串插入另一個表中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM