SQL Database

Paul Armstrong 0 Reputation points
2024-02-12T03:18:21.9333333+00:00

I’ve been having an issue connecting to a SQL database be it an azure server or the express version in Visual Studio. I have tried downloading the Microsoft SQL server express since all I need as of right now is just the local database, and each time it fails downloading. I have tried looking online through Microsoft Q&A, Stack Overflow, and just general searches. The SQL server express is not running and every time I try to start having it run I keep on getting the error “The path cannot be found”. I’m new to Visual Studio and I have tried ADO.NET and Entity Framework Core. I have asked my professor in college for potential fixes. I have a Microsoft Galaxy Book Go 5g and a server for my computer does show up in the server explorer so I do not know if this is the problem or not. If anyone can help that will be appreciated. I have also tried connecting to an Azure Server that I created and that hasn’t worked either.

Azure SQL Database
SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 61,116 Reputation points
    2024-02-13T16:31:19.5333333+00:00

    You don't need to download any SQL Server versions. If you install Visual Studio with Data Science workload then it includes a local copy of SQL Server, localDb, that you should be developing against. This version is designed for building apps with a database that will eventually connect to a hosted SQL Server, on premise or the cloud.

    You can confirm you have this installed by going to SQL Server Object Explorer in Visual Studio. It should show you 2 nodes. The first node is for any SQL projects you have loaded in your solution. The second node is for the LocalDb instance that is available. It is this instance that you'll generally develop against.

    While you can use SQL Server Object Explorer to create tables, add data, etc it is generally easier to create a SQL Project with your tables and data and then deploy (by running it in VS) to your LocalDb instance. When you're ready to start working with a hosted SQL Server instance you can deploy your SQL project to it (or copy the scripts and run them).


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.