samedi 25 avril 2015

where to look for db file after update-database

I create domain classes, it's db tables representations using entity framework. Using migrations seed method I created init data. in console window I use Update-Database command to create db and seed data. Now I dont know where to find this database file and to attach in server explorer.

My App.config connection string looks

<configuration>
  <connectionStrings>
    <add name="MyDbContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=MyDbContext;Integrated Security=True;AttachDBFilename=|DataDirectory|MyDbContext.mdf" providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

I look up in App_Data folder, tried to attach db using server explorer but I dont know where to browse to add. What I'm doing wrong here

Aucun commentaire:

Enregistrer un commentaire