Unable to connect to SQL Server database in my ASP.NET Core project

Viewed 273

I have tried to connect to a SQL Server database using the following steps:

Tools In MenuBar of Visual Studio

-> Tools -> "Connect To Database"

"Add connection" gave me the server name to use:

Add connection

Test connection succeeds:

test connect succeeds

But after clicking on "OK", this error pops up:

ERROR

2 Answers

The steps you've described for connecting to the database are for the Server Explorer in the IDE -- the error dialog and message clearly indicate this. This is not related to an ASP.NET Core project. These steps can be performed w/o any solutions/projects opened in the IDE.

It's likely an issue with your installation. Try a "modify/repair" install, or a even a clean install. If the issue persists, open a ticket with the Visual Studio team. To open a ticket, from inside the IDE, at the top right corner, click the icon for sending feedback (next to the "Live Share" icon) and follow the prompts.

Please note that not being able to create a database connection in Server Explorer will NOT prevent you from coding an ASP.NET Core app that connects to that database.

Related