SqlException (0x80131904): Invalid object name 'dbo.Categories'

后端 未结 5 573
我寻月下人不归
我寻月下人不归 2020-12-03 07:47

I am getting the exception above when I run an application. The application is using asp.net mvc 3 / C#. I made an mdf file and added it under App_Data folder in Visual Web

5条回答
  •  春和景丽
    2020-12-03 08:31

    What you really want to do to fix this is in you Context class you should have a method called OnModelCreating... make sure it has this:

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Conventions.Remove();
    }
    

提交回复
热议问题