Professional C #7 and .NET Core 2.0 I am getting an unhandled exception in Chapter 25 ADONetSamples,

Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open database “Books” requested by the login. The login failed.
Login failed for user ‘DESKTOP-6N6BRC7\bruce’.
at System.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at ConnectionSamples.Program.OpenConnection() in C:\C# 7 Source\Pro C # 7 and .Net Core 2.0\Full Code Download\Full Code Download\Chapter 25\25_code\ADONetSamples\ConnectionSamples\Program.cs:line 58
at ConnectionSamples.Program.Main(String[] args) in C:\C# 7 Source\Pro C # 7 and .Net Core 2.0\Full Code Download\Full Code Download\Chapter 25\25_code\ADONetSamples\ConnectionSamples\Program.cs:line 21

C:\Program Files\dotnet\dotnet.exe (process 10388) exited with code -532462766.
Press any key to close this window . . .

Did you look at the SQL Server error log to determine the details of the error?

E.g. did you fail to set up SQL Server to accept Windows authentication? 

I.e. see this