question

Fans-5785 avatar image
0 Votes"
Fans-5785 asked TimonYang-MSFT commented

Why can't I retrieve the list of servers when my vs2019 connects to the database

83086-2021-03-31-13-37-53.jpg


There is a SQL Server on my computer, but I can't retrieve it anyway,
Ask for help. Thanks

dotnet-sqlitedotnet-sqlclient
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered TimonYang-MSFT commented

You can manually enter the server name to establish a connection.

Sql Server Object Explorer view can connect to the server correctly, and then you can see the server name, copy the server name and then come to this page to connect to the server.

83146-4.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


4.png (54.5 KiB)
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The name of the server on which the database is installed on my computer is just the name of the computer, but the name of the server on which the database is installed on someone else's computer is the name of the computer \ instance. Is that the reason?Thanks

0 Votes 0 ·

I have reinstalled SQL Server several times. It's just the computer name, not the computer name\instance name

0 Votes 0 ·

@Fans-5785
I have not encountered this situation before, click View -> Sql Server Object Explorer on the menu.
Click the Add sql server button, what does the window look like?
This is my window:
83130-2.png

0 Votes 0 ·
2.png (30.4 KiB)

This is my window, but mine seems to be similar to yours
83266-2021-03-31-19-49-25.jpg


0 Votes 0 ·

In this case, using (localdb)\MSSQLLocalDB as the server name should be able to establish a connection.
Just like in the picture above, I can successfully connect and get all the databases in this server correctly.
83428-3.png
Have you tried and still can't work?

0 Votes 0 ·
3.png (10.0 KiB)

Hi @Fans-5785, I have not heard from you for a couple of days. Please let me know if there is anything that I can help here.

0 Votes 0 ·