Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 注册为用户失败。。。Asp.net mvc实体框架_C#_Asp.net Mvc_Entity Framework - Fatal编程技术网

C# 注册为用户失败。。。Asp.net mvc实体框架

C# 注册为用户失败。。。Asp.net mvc实体框架,c#,asp.net-mvc,entity-framework,C#,Asp.net Mvc,Entity Framework,我正在学习这个MvcMovie教程,我正在做一些改变 最初,我有两个从DbContext派生的类,一个用于电影,另一个用于用户 所以我把它们移到了一个DbContext中 public class MovieDBContext : DbContext { public DbSet<Movie> Movies { get; set; } public DbSet<UserProfile> UserProfiles { get; set; } } 错误是

我正在学习这个MvcMovie教程,我正在做一些改变

最初,我有两个从DbContext派生的类,一个用于电影,另一个用于用户

所以我把它们移到了一个DbContext中

public class MovieDBContext : DbContext
{
    public DbSet<Movie> Movies { get; set; }
    public DbSet<UserProfile> UserProfiles { get; set; }


}
错误是这样的:

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。。。。我不知道这是我的问题的一部分还是与之无关……

我认为这与jQuery无关。如果对UserProfile模型进行了更改,则这些更改需要反映在数据库中。您可以发布完整的注册控制器操作和您的用户配置文件模型吗。
    /* 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
 */