✅ cannot connect console dotnet project with microsoft SQL
I'm following this : https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-dotnet-core?view=azuresql-mi
I'm running microsoft sql from docker. I can access my database from azure data studio by setting server as "localhost" so I tried to do the same in my code. My confusion is here
builder.DataSource = "<your_server.database.windows.net>";
setting "server" in azure data studio works so I thought it should work as well in code but it throws error when I do this:
builder.DataSource = "localhost";
or this
builder.DataSource = "localhost.database.windows.net";
What am i doing wrong?Use .NET to connect and query a database on Windows, Linux, or macO...
This topic shows you how to use .NET to create a program that connects to a database in Azure SQL Database, or Azure SQL Managed Instance, and queries it using Transact-SQL statements.
2 Replies
Read the error message. It clearly states that your remote certificate was rejected.
You'll likely want to disable cert validation while developing
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.