Search⌘ K
AI Features

Creating the SQL Server Database

Understand how to set up a SQL Server database, add necessary tables, and seed data for building an expense tracker application. This lesson guides you through updating connection strings, using Entity Framework migrations, and testing the API with ExpenseTypesController to ensure proper integration with your Blazor WebAssembly project.

We'll cover the following...

We need to create the SQL Server database and add two tables to it. We do this as follows:

  1. Open the ExpenseTracker.Server\appsettings.json file.

  2. Update the connection string to point to your instance of SQL Server and change the name of the database to ExpenseTracker:

C++
"ConnectionStrings": {
"ExpenseTrackerServerContext": "Server=TOI-WORK\\SQLEXPRESS2019; Database=ExpenseTracker; Trusted_Connection=True; MultipleActiveResultSets=true"
}

The preceding code assumes that our server is named ...