Reputation: 2887
I've Create MVC5 APP with Local DB like the following link(step 1 to 5) http://www.asp.net/mvc/tutorials/mvc-5/database-first-development/creating-the-web-application And the application is running as expected and now I need to change the DB from the sql Lite to azure DB ,I have created the same DB in azure (same data structure)and now what I want that the application use this DB ,There is simple way to do that ?
Im using VS2013 for web.
Upvotes: 0
Views: 1047
Reputation: 836
Just change the "source" and "initial catalog" parameters of the connection string in the web.config file. Also, SQL Azure doesn't work with integrated security so you need to remove the "integrated security" parameter from the connection string and add the parameters "User ID" and "Password" with the credential of a user that you created in SQL Azure.
You should find something similar to:
<add name="testEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\test.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
You need to:
Upvotes: 2