0

enter image description here

Before My database name was NSSystem.bka

I renamed it to dwarozhmadxal.bak Now when i insert data to purchasedetail table this error is show

Thanks for helping me

  • well obviously you have changed database name so Entity Frame work is trying to connect to your db with same old name. and can't find that db so giving you this error – Hammas Apr 13 '20 at 18:08
  • You'll need to update entity models in your project if you are using DB First Approach. or manually make changes everywhere. – Hammas Apr 13 '20 at 18:09
  • Thanks for replying dear , but i deleted the entity model in visual studio and creating new model with renamed db! – Dyare Abubakr Apr 13 '20 at 18:23
  • I don't know why it's trying to connect the old db name? – Dyare Abubakr Apr 13 '20 at 18:30
  • And when i find or search for (NCSystem)word Can't find any thing intire my project in visual studio – Dyare Abubakr Apr 13 '20 at 18:33
  • you just need to update EntityModel or EDMX if you are using EF 6. and Connect to new db `dwarozhmadxal` it will auto update where ever it is required. – Hammas Apr 14 '20 at 03:29
  • https://stackoverflow.com/questions/2947511/entity-framework-how-do-you-refresh-the-model-when-the-db-changes – Hammas Apr 14 '20 at 03:29
  • 1
    I updated it more than 5 times or deleting after creating finally it's not solved – Dyare Abubakr Apr 15 '20 at 18:21

0 Answers0