最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - A Network-related or Instance-specific error - TCP Provider - have switched to Macbook pro m4 - Stack Overflow

programmeradmin1浏览0评论

It's like my problem is that I can't access the database through my Blazor application that I've made. But if I write it to a Windows PC, I have no problems, but as soon as I'm on my Macbook pro, I have problems accessing the database.

The database is in Azure SQL Server. I've tried to look at how it could be that I can't access the database through my Mac, but I can if I access it through Windows.

Error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 26 - Error Locating Server/Instance Specified)

It's like the Blazor server app is built in EF, and I've checked several times to see if I've entered the correct information for the database with password, etc.

I have try to open terminal - its returning success!

nc -v xxxxx.database.windows 1433
Server=tcp:xxxx.database.windows,1433;Initial Catalog=sxxx;Persist Security Info=False;User ID=xxx;Password=xxxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

This is my code for connection to the database: I have tried copying connection strings from ODBC and ADO on my database which is on Azure and both fail. And remove the old one which was on the website but then added the one which is from the Azure page.

Thus I also use EF (Entity Framework) to talk to my database. I have:

Microsoft Entity Framework Core design, + SQL design and tool

发布评论

评论列表(0)

  1. 暂无评论