I've a C# application which connects to a local DB running on SQL Server Express. The application should generate the tables.
I have the following in my appsettings.json:
"ConnectionStrings": {
"VHDatabase": "Server=(localDb)\\SQLEXPRESS;AttachDbFilename=C:\\Program Files\\Microsoft SQL Server\\MSSQL15.SQLEXPRESS\\MSSQL\\DATA\\VHDatabase.mdf;Database=VHDatabase;Trusted_Connection=True;MultipleActiveResultSets=true;Integrated Security=true;User Instance=true;"
}
The connection is done with this in my startup.cs:
var connection = Configuration.GetConnectionString("VRHitDatabase");
services.AddDbContext<VHContext>
(options => options.UseSqlServer(connection));
When I run the application no tables are created and I can't see any evidence of the connection existing. Is there any way I can do this or at least confirm my connection string is correct??