Unable to Scaffold SQL Server from Visual Studio

Avatar
  • updated
  • Answered

I have a server set up through InMotionHosting. I am able to connect to it through MySQL Workbench. I can add, edit, delete, everything without any issues. In visual studio, I can connect to the server through the Server Explorer. Through the Server Explorer, I can see what tables and columns I have. When I try to scaffold the server though, using the same connection information I use everywhere else, I get this 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

Pinned replies
Avatar
Ronnie H.
  • Answer
  • Answered

Hello, and sorry to hear you're running into trouble connecting Visual Studio to your database. If MySQL Workbench is connecting without issue but Visual Studio is running into trouble, the easiest way to figure out what is going on is to check the MySQL error logs on server side. They'll likely have more information on why the server chose to block the connection. You can check these either in cPanel itself or directly on the server after you SSH in, if you're on a VPS plan or above. If you're having trouble finding or interpreting error logs, feel free to reach out to our live Support team for assistance. Hope that helps you solve the issue!

Avatar
Ronnie H.
  • Answer
  • Answered

Hello, and sorry to hear you're running into trouble connecting Visual Studio to your database. If MySQL Workbench is connecting without issue but Visual Studio is running into trouble, the easiest way to figure out what is going on is to check the MySQL error logs on server side. They'll likely have more information on why the server chose to block the connection. You can check these either in cPanel itself or directly on the server after you SSH in, if you're on a VPS plan or above. If you're having trouble finding or interpreting error logs, feel free to reach out to our live Support team for assistance. Hope that helps you solve the issue!