0
好吧,我需要更新到真正的現場活動,這是代碼鏈接到SQL更新行
public static bool FirstLogin(Guid ActivationCode)
{
using (InfinityNightDataContext data = new InfinityNightDataContext())
{
User user = data.Users.Single(User => User.EmailActivation == ActivationCode);
if (user != null)
{
user.Active = true;
user.Exp = "i HAs here";
data.SubmitChanges();
InstallMembershipCookie(user.UserId, user.Email, user.Password, user.UserType, user.FirstName, user.UserImg, "", true);
return true;
}
else
{
return false;
}
}
}
後data.SubmitChanges()
;我可以看到對象用戶的變化,但不在數據庫在其他功能,但在這種情況下,它是行不通的。
任何人知道是什麼問題?
您確定該用戶不爲空? –