am getting following error when am inserting data
The model backing the 'ReceiptsDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database
mymodel
public class Transaction_GeneralInfo
{
[Key]
public string CompanyName { get; set; }
public int VNumber { get; set; }
} public class Accounting_PendingBills
{
[Key]
public String Branch { get; set; }
public string Currency { get; set; }
public string CompanyName { get; set; }
}
public class ReceiptsViewModel
{
public String Branch { get; set; }
public string Currency { get; set; }
public int VNumber { get; set; }
public string CompanyName { get; set; }
}
public class ReceiptsDbContext : DbContext
{
public DbSet pendings { get; set; }
public DbSet transactionGeneralInfo { get; set; }
}
public ActionResult Index(ReceiptsViewModel receiptsModel, string Command)
{
if (Command == "Save")
{
ReceiptsDbContext db = new ReceiptsDbContext();
var transaction = new Transaction_GeneralInfo()
{
CompanyName = receiptsModel.CompanyName,
VNumber = receiptsModel.VNumber
};
var pending = new Accounting_PendingBills()
{
Branch = receiptsModel.Branch,
Currency = receiptsModel.Currency,
CompanyName = receiptsModel.CompanyName
};
db.transactionGeneralInfo.Add(transaction);
db.pendings.Add(pending);
db.SaveChanges();
}

Rajeev PunhaniRank #551 · 4.4K reputationPosted Aug 4, 2016, 3:13 AM EDT
Hi Suman ,
Please add thefollowing line in your Application_Start event.
If the above solution is helpful then,accept the answer.
suman goud159 reputationPosted Aug 4, 2016, 3:55 AM EDT
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
Vinay SinghRank #604 · 4K reputationPosted Aug 4, 2016, 4:04 AM EDT
Rajeev PunhaniRank #551 · 4.4K reputationPosted Aug 4, 2016, 9:21 AM EDT
If the above solution is helpful then,accept the answer.