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 PatelPosted Dec 15, 2022, 5:39 AM
Hi Tyronne Engstrom,
Try following:
For more details:
Hope this will help you!
Ajay SinghPosted Dec 15, 2022, 1:24 PM
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"
tyronne EngstromPosted Dec 15, 2022, 7:08 AM
Thx you!
That did do it :-)
// Tyronne
Jignesh KumarPosted Dec 14, 2022, 6:36 PM
Hello ,
Can you please use this one.
https://www.aspsnippets.com/Articles/Net-Core-Set-Connection-String-with-Windows-Authentication-in-AppSettingsjson.aspx