C# 7 and .NET Core:
Modern Cross-Platform
Development
Written by Mark J. Price
Published by Packt Publishing.
Written by Mark J. Price
Published by Packt Publishing.
The following code has incorrect extra underscores (_) after the 0b and 0x notations:
int decimalNotation = 2_000_000; // 2 million
int binaryNotation = 0b_0001_1110_1000_0100_1000_0000; // 2 million
int hexadecimalNotation = 0x_001E_8480; // 2 million
The code should be:
int decimalNotation = 2_000_000; // 2 million
int binaryNotation = 0b0001_1110_1000_0100_1000_0000; // 2 million
int hexadecimalNotation = 0x001E_8480; // 2 million
The code for the Microsoft SQL Server connection string has a missing parameter. Add MultipleActiveResultSets=true; as shown in the following code:
// for Microsoft SQL Server
optionsBuilder.UseSqlServer(
@"Data Source=(localdb)\mssqllocaldb;" +
"Initial Catalog=Northwind;" +
"MultipleActiveResultSets=true;" +
"Integrated Security=true;");