Reputation: 297
I have built my MVC 5 project with a database using entity framework db first. I published my website but had problems with my database.after lots of research to solve the problem,i figured to build my database on azure since it's only 2 tables and copied the connection string to the web.config file on my MVC 5 project. when publishing again with the new connection string update, an error showed indicating that can't find the database:
The system cannot find the file specified
Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
This is what the azure offered me as a connection String:
Server=tcp:idud662mdp.database.windows.net,1433;Database=sportsMArAiCkhuw;User ID=sportsMania@idud662mdp;Password={your_password_here};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;
I have modified it and this is my connectionString:
<add name="DataEntryNew" connectionString ="Data Source=idud662mdp.database.windows.net;Database=sportsMArAiCkhuw;User ID=sportsMania@idud662mdp;Password=My-Pass;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient"/>
What's going wrong?
Upvotes: 0
Views: 75
Reputation: 580
Your connection string is not the same one as provided by Azure. Try changing the DataEntryNew
tag in the web.config file to:
<add name="DataEntryNew" connectionString ="Server=tcp:idud662mdp.database.windows.net,1433;Database=sportsMArAiCkhuw;User ID=sportsMania@idud662mdp;Password={your_password_here};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient"/>
Upvotes: 1