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
1条答案
按热度按时间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