The error message you post means that the SQL Server instance you are trying to connect to does not exist or is not running. You need to figure out what connection string you have in VS 2022.
My SQL Server stopped working
I was using the asp.net web development with the visual basic language in the visual studio 2019, my sql server used to work until i opened an asp.net project from visual studio 2022, and i was getting this error message "cannot be opened because it is version 904. This server supports version 852 and earlier. A downgrade path is not supported." then I searched this and found that I needed to uninstall my 2016 version of the sql server and then install the 2019 one. As I done so I also downloaded the visual studio 2022. Then I gotten a different errors message immediately "The attempt to attach to the database failed with the following information:
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
)"
I've tried to completely reinstall both the 2019 and the 2022 versions of the visual studio but it's still not working. I would really appreciate the help as soon as possible.
Developer technologies VB
Developer technologies ASP.NET Other
SQL Server Other
2 answers
Sort by: Most helpful
-
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
2022-05-11T20:58:27.49+00:00 -
Yijing Sun-MSFT 7,096 Reputation points
2022-05-12T02:09:41.563+00:00 Hi @A Sailor ,
I think you may need to create an instance. Have you ever created an instance of localdb 15?
If not, runSqlLocalDB.exe create "instancename" 15.0 -s
in cmd.
Best regards,
Yijing Sun
If the answer 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.