Search⌘ K
AI Features

Setting up SQL Server

Explore how to set up a SQL Server database for your Blazor WebAssembly task manager application. Learn to update connection strings, apply Entity Framework migrations, and verify data using SQL Server Object Explorer. This lesson ensures your backend is ready for tasks management before client-side development.

We'll cover the following...

We need to create a new database on SQL Server and add a table to contain the tasks. We do this as follows:

  1. Open the TaskManager.Server\appsettings.json file.
  2. Update the connection string to point to our instance of SQL Server and change the name of the database to TaskManager:
C#
"ConnectionStrings": { "TaskManagerServerContext": "Server=TOI WORK\\ SQLEXPRESS2019; Database=TaskManager; Trusted_ Connection=True; MultipleActiveResultSets=true"}

The preceding code assumes that our server is named TOI-WORK\\\ SQLEXPRESS2019 and the name of the database is ...