EF switching from one db to another .edmx settings how to?
I have an mvc3/EF4.1 model that has an .edmx bound to a Db locally. I have to move this model to Databa开发者_C百科se to another server.
Q: What steps do I need to make so that when I right click on the .edmx and "Update Model/Database" that it selects and picks up that same model but on the new server? Thx!
Open your web.config and look at your block. The connection information to the server is listed in there. Simply change it to the new server.
The full format is listed here: http://msdn.microsoft.com/en-us/library/cc716756.aspx
If the new server is using the same authentication, just change the server name (the 'Data Source=localhost' section) to be your new server name.
精彩评论