Home > Net >  In VS created in Windows forms application there was an error connecting to the database
In VS created in Windows forms application there was an error connecting to the database

Time:04-27

Error message: System. The 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: Named Pipes provider, error: 40 - Could not open A connection to SQL Server)"

The great god teach me how to solve

CodePudding user response:

See the connection instance name is correct, and whether the SQL Server is configured to allow remote connections

CodePudding user response:

Use udl file under test connection and then copy

CodePudding user response:

Is the correct SQL Server also allow remote connections

CodePudding user response:

Use udl file test connection is successful
  •  Tags:  
  • C#
  • Related