Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.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
ASP.NETWebForms教程有一个错误——如何排除故障_Asp.net_Webforms - Fatal编程技术网

ASP.NETWebForms教程有一个错误——如何排除故障

ASP.NETWebForms教程有一个错误——如何排除故障,asp.net,webforms,Asp.net,Webforms,我正在学习ASP.NET Web表单教程 ProductContext定义了两个表:类别和产品 使用System.Data.Entity namespace WingtipToys.Models { public class ProductContext : DbContext { public ProductContext() : base("WingtipToys") { } publ

我正在学习ASP.NET Web表单教程

ProductContext定义了两个表:类别和产品

使用System.Data.Entity

namespace WingtipToys.Models
{
    public class ProductContext : DbContext
    {
        public ProductContext()
            : base("WingtipToys")
        {
        }

        public DbSet<Category> Categories { get; set; }
        public DbSet<Product> Products { get; set; }
    }
}
名称空间WingtipToys.Models
{
公共类ProductContext:DbContext
{
公共产品上下文()
:基部(“翼尖足”)
{
}
公共数据库集类别{get;set;}
公共数据库集产品{get;set;}
}
}
这是反映在这里,红色圆圈

但是,如果我按照教程修改代码

然后构建项目时,ShoppingCartItems表不会出现

当我按F5调试项目时,我得到以下错误


如何排除故障?

@Glowie,由于您的数据库结构因添加ShoppingCartItems而发生更改,因此您需要按照说明启用并运行EntityFramework迁移。你说得对,本教程缺少这一步,因此出现错误的原因是

你是否尝试过向教程/文章的作者发表评论?@CodeX是的,我有,仍在等待回复