Microsoft® Visual C#® 2008 Step by Step

Errata for Microsoft® Visual C#® 2008 Step by Step




The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page 19

"XMLPad" should be "XAMLPad" On page 19, the third sentence in the second to the last paragraph on the page contains an incorrect name for a Windows SDK tool. Change: "You can actually define a WPF form completely by writing an XAML description if you don’t like using the Design View window of Visual Studio or if you don’t have access to Visual Studio; Microsoft provides an XAML editor called XMLPad that you can download free of charge from the MSDN Web site." To: "You can actually define a WPF form completely by writing an XAML description if you don’t like using the Design View window of Visual Studio or if you don’t have access to Visual Studio; Microsoft provides an XAML editor called XAMLPad that is installed with the Windows SDK."

Microsoft Press  May 06, 2010 
Printed
Page 41

Parenthesis in the wrong place On page 41, the fourth sentence of step 7 contains a misplaced parenthesis. Change: "(54 – ((54/13) * 13) is 2 if you do the arithmetic rounding down to an integer at each stage—my old math master at school would be horrified to be told that (54/13) * 13 does not equal 54!)" To: "(54 – ((54/13) * 13)) is 2 if you do the arithmetic rounding down to an integer at each stage—my old math master at school would be horrified to be told that (54/13) * 13 does not equal 54!"

Microsoft Press  Jul 13, 2010 
Printed
Page 43

string should be int and vise versa On page 43, the second sentence of the third paragraph is incorrect. Change: "Remember that the Text property is a string and that the result of the calculation is an int, so you must convert the string to an int before assigning it to the Text property." To: "Remember that the Text property is a string and that the result of the calculation is an int, so you must convert the int to a string before assigning it to the Text property."

Microsoft Press  May 06, 2010 
Printed
Page 82

> should be < On page 82, the last sentence of step 8 is incorrect. Change: "If the current character being copied is a >, this code will append the string “&lt;” to the text being output in its place." To: "If the current character being copied is a <

Microsoft Press  Jul 13, 2010 
Printed
Page 83
Step 12

inRange = (lo <= number) && (hi >= number) should have a semi-colon at the end - inRange = (lo <= number) && (hi >= number);

Note from the Author or Editor:
This is a minor typo, but the reader is correct. In step 12, there should be a semi-colon at the end of the text that is displayed.

Anonymous  Dec 10, 2010 
Printed
Page 195

10 should be 11 On page 195, lines 10 and 17 of the code sample refer to 10 rather than 11. Change: // iterate remaining 10 elements using a for statementTo: // iterate remaining 11 elements using a for statementChange: // iterate remaining 10 using a foreach statementTo: // iterate remaining 11 using a foreach statement

Microsoft Press  May 06, 2010 
Printed
Page 219

"Horse : Whale" should be "Whale : Mammal" On page 219, the eleventh line of the second code sample is incorrect. Change: class Horse : WhaleTo: class Whale : Mammal

Microsoft Press  Jul 13, 2010 
Printed
Page 222

myMammal should be new Mammal On page 222, the first line of the second code sample is incorrect. Change: Mammal myMammal = myMammal(“Mammalia”);To: Mammal myMammal = new Mammal(“Mammalia”);

Microsoft Press  May 06, 2010 
Printed
Page 256

"public" should be removed On page 256, the code sample in the "Implement an interface" section is incorrect. Change: class Test : IDemo { public string IDemo.Name() { ... } public string IDemo.Description() { ... } }To: class Test : IDemo { string IDemo.Name() { ... } string IDemo.Description() { ... } }

Microsoft Press  Jul 13, 2010 
Printed
Page 259

"this." should be removed On page 259, the first code sample contains several instances of "this." that should be removed. Change: class Tally { public Tally() { this.instanceCount++; } ~Tally() { this.instanceCount--; } public static int InstanceCount() { return this.instanceCount; } ... private static int instanceCount = 0; }To: class Tally { public Tally() { instanceCount++; } ~Tally() { instanceCount--; } public static int InstanceCount() { return instanceCount; } ... private static int instanceCount = 0; }

Microsoft Press  May 06, 2010 
PDF
Page 299
First code example

bool peek = bits[6]; // retrieve bool at index 6; should be true (1) should read: bool peek = bits[6]; // retrieve bool at index 6; should be false (0) // the value in adapted is now 111011, or 59 in decimal should read: // the value in adapted is now 110111, or 55 in decimal

Note from the Author or Editor:
This is a copy of the issue reported on August 9th (albeit for the 2010 edition of the book). The reader is correct.

Bob Verhey  Apr 02, 2011 
Printed
Page 321

=> missing from code sample On page 321, the last code sample is missing an operator. Change: (ref int x, int y) { x++; return x / y; }To: (ref int x, int y) => { x++; return x / y; }

Microsoft Press  Jul 13, 2010 
Printed
Page 453

DockControl should be DockPanel On page 453, the sentence before the Note refers to DockControl rather than DockPanel. Change: "In the Properties window, set the Width property of the DockControl to Auto, set the HorizontalAlignment property to Stretch, set the VerticalAlignment property to Top, and set the Margin property to 0." To: "In the Properties window, set the Width property of the DockPanelto Auto, set the HorizontalAlignment property to Stretch, set the VerticalAlignment property to Top, and set the Margin property to 0." The sentence after the Note contains the same error. Change: "The DockControl control should appear at the top of the form, occupying the full width of the form." To: "The DockPanelcontrol should appear at the top of the form, occupying the full width of the form."

Microsoft Press  May 06, 2010 
Printed
Page 459

newMember_Click should be exit_Click On page 459, step 7 refers to newMember_Click rather than exit_Click. Change: "Switch to the Code and Text Editor window. In the body of the exitClick method, type the statement shown in bold type in the following code:" private void newMember_Click(object sender, RoutedEventArgs e) { this.Close(); }To: "Switch to the Code and Text Editor window. In the body of the exit_Click method, type the statement shown in bold type in the following code:" private void exit_Click(object sender, RoutedEventArgs e) { this.Close(); }

Microsoft Press  Jul 13, 2010 
Printed
Page 465

clearText should be clearName On page 465, in step 4, clearText is referenced in place of clearName. Change: "Return to the definition of the textBoxMenu style, and to the clearText menu item add a Click event method called clearName_Click. (This is the default name generated by the command.) " To: "Return to the definition of the textBoxMenu style, and to the clearName menu item add a Click event method called clearName_Click. (This is the default name generated by the command.) "

Microsoft Press  May 06, 2010 
Printed
Page 513

table should be class On page 513, the last sentence refers to a table instead of a class. Change: "Notice that the two properties in the Product table that correspond to columns that permit null values in the database (SupplierID and UnitPrice) are defined as nullable types in the entity class." To: "Notice that the two properties in the Product class that correspond to columns that permit null values in the database (SupplierID and UnitPrice) are defined as nullable types in the entity class."

Microsoft Press  Jul 13, 2010 
Printed
Page 517

Product should be Products On page 517, the last sentence refers to a Product table rather than a Products table. Change: "Phrasing this relationship slightly differently, a row in the Product table can reference a single row in the Suppliers table through the SupplierID columns in both tables, but a row in the Suppliers table can reference" To: "Phrasing this relationship slightly differently, a row in the Products table can reference a single row in the Suppliers table through the SupplierID columns in both tables, but a row in the Suppliers table can reference"

Microsoft Press  May 06, 2010 
Printed
Page 538

WpfApplication1.Window1 should be Suppliers.SupplierInfo On page 538, the first line of the code sample in step 7 is incorrect. Change: To:

Microsoft Press  Jul 13, 2010 
Printed, PDF
Page 548
3rd & 4th paragraph

The example on adding a new item to a table via DLINQ is using a pre-Visual Studio 2008 RTM method. The book is using the Add method but it should be InsertOnSubmit.

Note from the Author or Editor:
The reader is correct. Since the book was published, the methods of the Table<TEntity> class have changed, and the Add method has been renamed as InsertOnSubmit. The final statement in the code block in the top half of page 548 should now read: products.InsertOnSubmit(newProduct);

Steven Wiley  Mar 29, 2011 
Printed, PDF
Page 548
7th & 8th paragraph

The example on removing an item from a table via DLINQ is using a pre-Visual Studio 2008 RTM method. The book is using the Remove method but it should be DeleteOnSubmit.

Note from the Author or Editor:
The reader is correct. Since the book was published, the methods of the Table<TEntity> class have changed, and the Remove method has been renamed as DeleteOnSubmit. The final statement in the code block in the lower half of page 548 should now read: products.DeleteOnSubmit(product);

Steven Wiley  Mar 29, 2011 
Printed
Page 555

Additional code needed in sample On page 555, in the 13th line of the second code sample, an ArgumentOutOfRangeException must be caught for the application to function as expected. Change: productsInfo.Add(newProd);To: try { productsInfo.Add(newProd); } catch (ArgumentOutOfRangeException e) { }

Microsoft Press  May 06, 2010 
Printed
Page 564
Bottom - step 4

Folder in sample code doesn't seem to exist. asking for ..Litware, but only the ..Completed Litware folder is on my CD. :(

Note from the Author or Editor:
Using Windows Explorer, create the Litware folder manually under the Chapter 27 folder.

Jonathan M.  May 28, 2011 
Printed
Page 633

Service should be ProductsService On page 633, the first line of step 10 is incorrect. Change: "Add the HowMuchWillItCost method to the Service class, as follows:" To: "Add the HowMuchWillItCost method to the ProductsService class, as follows:"

Microsoft Press  Jul 13, 2010 
Printed
Page 634

Service should be ProductsService On page 634, the first line of step 11 is incorrect. Change: "Add the GetProductInfo method shown below in bold type to the Service class:" To: "Add the GetProductInfo method shown below in bold type to the ProductsService class:" Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Microsoft Press  May 06, 2010