I have been developing an application over the last few months using EF code first approach with SQL Server Express. It has been great but now I am ready to deploy my application to a live server I need to be able to begin using EF with a standard SQL Server Management Studio data开发者_如何学Pythonbase.
I have scripted the db from my personal instance of SQL Server Express and created the db on the live server via management studio. I have also copied the data from the EdmMetadata table to the live db.
Will I be able to continue using DbContext
the same way as before and simply change the connection string? I assume I won't so what are the issues facing this?
YES OF COURSE!
SQL Server (Express or Standard or Enterprise editions) are absolutely 100% binary compatible - SQL Server Express IS a full-blown SQL Server edition, same code-base as the other editions, only with some "artificial" (marketing-induced) limitations....
You could even create a BACKUP from your SQL Server Express (to a .bak
file) and restore that back onto a "full-blown" SQL Server edition - works flawlessly.
And YES - EF can absolutely connect to a full-blown SQL Server, too - with all three coding approaches (database-first, model-first, code-first). All you need to change is your SQL Server connection string that you have stored somewhere.
精彩评论