Azure SQL Connection String not working

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I just added a new SQL database to my Azure account. For some reason the connection string provided isn't working.
What might cause this?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Pawan KumarDatabase Expert
Awarded 2016
Top Expert 2016

Commented:
What connection string you are setting. See this link how you can get the actual connection string -

https://www.experts-exchange.com/questions/29065679/restructure-connection-string-for-Azure.html

once you get the connection string just change the line where you are setting the connection.
Murray BrownHead Developer

Author

Commented:
In Azure they provide a connection string as follows

Server=tcp:xxxx.database.windows.net,1433;Initial Catalog=xxxxxx;Persist Security Info=False;User ID=xxxxx;Password=xxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Senior Developer
Commented:
Do you connect from the same IP? Otherwise you need to set a firewall rule.
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Top Expert 2016
Commented:
sample connection strings
test azure connnection stringsTest in visual studio
ste5anSenior Developer

Commented:
And when you connect from SSMS, you need to set the database in the Options dialog of the Login window.
Murray BrownHead Developer

Author

Commented:
Thanks Ste5an. Yes I am connecting from the same IP address
Murray BrownHead Developer

Author

Commented:
Thanks David. I got my connection string from a similar looking screen in Azure
Murray BrownHead Developer

Author

Commented:
Thanks for the help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial