Hi!
I can´t connect to my SQL Server from my app in VS 2022.
Here is the message:
System.Data.SqlClient.SqlException: '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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)'
here is the connection string:
connectionString="Server=.\POINTMAN;Database=Tournament;Trusted_Connection=True;" providerName="System.Data.SqlClient"
I have Google and google for a solution and try all the greate tips. So I need som more help:
// Tyson

Pankajkumar PatelRank #181 · 13.4K reputationPosted Dec 15, 2022, 12:39 AM EST
Hi Tyronne Engstrom,
Try following:
connectionString="Data Source=POINTMAN;Initial Catalog=Tournament;Integrated Security=true;"For more details:
Hope this will help you!
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 14, 2022, 1:36 PM EST
Hello ,
Can you please use this one.
connectionString: "Data Source=.\POINTMAN;Initial Catalog=Tournament;Integrated Security=true"https://www.aspsnippets.com/Articles/Net-Core-Set-Connection-String-with-Windows-Authentication-in-AppSettingsjson.aspx
tyronne Engstrom9 reputationPosted Dec 15, 2022, 2:08 AM EST
Thx you!
That did do it :-)
// Tyronne
Ajay SinghRank #1,163 · 1.6K reputationPosted Dec 15, 2022, 8:24 AM EST
Hi, Just try by replacing DataBase and Trusted_Connection with "Initial Catalog" and "Integrated Security" respectively.
Hence your connecting string will be as below-
"Data Source=.\POINTMAN;Initial Catalog=Tournament;Integrated Security=true"