-2

i have been developing my application with code first and i havent had any problem since i decided to use second database for my generated forms;

so i created a new context called FormContext and specified the connection string name in contractor(i suppose its enough for ef to differentiate the dbs); anyways if i dont explicitly initialize the db (second context), i get the error that second db does not exists; and if i do initialize , I DONT KNOW HOW AND WHY MY FIRST DB SCHEMA GETS CREATED IN SECOND DB ALSO!!!!!!!!!!!!!!!!!! I GET ALL THE TABLES + THE 3 THAT I NEEDED;

Navid Kianfar
  • 29
  • 1
  • 5

2 Answers2

0

If you are using PowerShell commands within the Package Manager Console in VS, check what's the default project selected when executing add-migration and update-database commands.

Tasio
  • 351
  • 1
  • 12
0

Can you tell me if you use the same variables in both connection string?. If you initialice the first connection string, and then change his variables to use in the second connection string (second context) the first connection string will change too. If you use two context use two connection string too.

VeGo
  • 1