[英]Registering as user fails… Asp.net mvc entity framework
我正在研究這個MvcMovie教程,我正在做一些改變.....
最初,我有兩個來自DbContext的類,一個用於電影,另一個用於用戶......
所以我將它們移動到單個DbContext ....
public class MovieDBContext : DbContext
{
public DbSet<Movie> Movies { get; set; }
public DbSet<UserProfile> UserProfiles { get; set; }
}
但是現在當我嘗試將自己注冊為用戶時,我在這行AccountController中收到錯誤
WebSecurity.CreateUserAndAccount(model.UserName, model.Password);
錯誤是這一個:
Cannot insert the value NULL into column 'xxx', table 'aspnet-MvcMovie-20120730162622.dbo.UserProfile'; column does not allow nulls. INSERT fails.
我不明白那是什么xxx,我在數據庫中看到,我發現沒有該名稱的列...我只在我的jquery文件中找到了xxx,就像這樣
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
我不知道那是什么..我還沒學過jquery ....我不知道它是否是我問題的一部分或它與它無關...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.