asp.net mvc - Cannot find the object "dbo.Addresses" because it does not exist or you do not have permissions -


my code this

 public class address {     public int id { get; set; }     public string city { get; set; }     public int postno { get; set; }     public string street { get; set; }  }   public class applicationdbcontext : identitydbcontext<applicationuser> {     public applicationdbcontext()         : base("defaultconnection", throwifv1schema: false)     {     }      public static applicationdbcontext create()     {         return new applicationdbcontext();     }     public system.data.entity.dbset<mearnit.models.address> addresses { get; set; }    } 

and when run update-database command on nuget package manager console hrows error.

cannot find object "dbo.addresses" because not exist or not have permissions. 

i have no idea why it's throwing error this. can point out what's going wrong here?

try command line:

open file explorer , browse folder project (within src folder). hold down shift on keyboard , @ same time right click on file explorer , select "open command window here"

a command windows should appear. now, enter following command:

dotnet ef migrations add initial. 

wait until command has finished executing. followed entering:

donet ef database update 

remember in order make changes database need delete initial.cs file in data/migrations folder before run commands. run commands again.

hope helps.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -