Migrations not build the database in SQL Server Express

wmomyfyw  于 2024-01-05  发布在  SQL Server
关注(0)|答案(1)|浏览(151)

I'm using the Entity Framework with code-first to build a database for my datalayer app, and I checked the connection string in web.config .

The datasource is ok and the initial catalog is ok and the migration command runs ok, but the database won't appear in SSMS. Probably should update the SQL Server or something ...?

The database-first approach is ok and the database will be created by running the app, but migrations do not create the database.

<connectionStrings>
    <add name="CMSTestContext" 
         connectionString="Data Source=DESKTOP-O0PS2HE\SQLEXPRESS;Initial Catalog=CMS_Test_CodeFirst;Integrated Security=True" 
         providerName="System.Data.SqlClient" />
</connectionStrings>

well i fix the problem by replacing the

and chnage identity to individual accounts and still don't know how this connection string work exactly and sorry for bad english and tanks to marc to edit my question

8e2ybdfx

8e2ybdfx1#

i fixed the problem with deleting the migration history and reason was out of sync database and the context in the app and still in confused about how to sync this tow and fix the problem with out deleting the migration history

相关问题