سؤال

I have created MVC5 project and in azure created DB that I want to connect to ,when I click on the model and add ADO.net entity data model -> generate from DB i got the following screen I click on new connection (I want to connect it to the azure DB) and I get the second screen ,what should I put there ? 1. I guess the IP but which exactly 2. in the credentials I guess of the user and password which i provide when I create the azure db. 3.Select or write db name - I guess i should see the DB which I created in the drop down list Any idea how to config the server name and if my assumption of 2&3 are correct . please provide detailed answer since I new to this issue...

Thanks in advance!

enter image description here

enter image description here

هل كانت مفيدة؟

المحلول

I assume you already created the SQL Azure database. The next steps are:

  • Go to the Azure Management Portal (manage.windowsazure.com) and navigate to the database you created
  • At the bottom of the main page there is the name of your server. Example: somecode.database.windows.net,1433. You must put this as "Server name" when you create the new connection.
  • Still in the main page, click on the link "Set up Windows Azure firewall rules for this IP address" to allow your local pc to access the sql azure server
  • In the "Logon to the server" section, you need to check "Use SQL Server Authentication" and put username and password that you set when you created your SQL Azure database.

نصائح أخرى

  • Open your azure management account
  • Dispay the Connection Strings of your DB and copy the Servername

DB Connection Strings with ServerName

  • Add your current IP to the firewall to allow a connection from your VS Add Firewall Rule
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top