Errata

C# Cookbook

Errata for C# Cookbook

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 49
Second code line from the bottom

int caseSensitiveResult = string.Compare( lowerCase,
StringComparison.CurrentCulture ) ;

should be:

int caseSensitiveResult = string.Compare( lowerCase, upperCase,
StringComparison.CurrentCulture ) ;

Anonymous   
Printed Page 61
mid-page

The second to last line of the code examples is:

Colors actualEnum = (Colors)Colors.Parse( typeof( Colors ), colorString ) ;

Should be:

Colors actualEnum = (Colors)Enum.Parse( typeof( Colors ), colorString ) ;

Anonymous   
Printed Page 801
Code for POST overload

The code as printed throws a ProtocolViolationException on the line ending in
'httpRequest.GetRequestStream())' because the Method property of the httpRequest object is set to GET.

This is fixed by adding 'httpRequest.Method = "POST"' anywhere between the initialization of the
httpRequest object and the offending line.

Anonymous   
Printed Page 838
2nd paragraph under "Discussion" heading

The code snippet does not match the program on the previous page. The snippet creates an XPathDocument
from a MemoryStream object. The complete program creates an XPathDocument from a StringReader object.

The text above the code matches the snippet, which means it is also incorrect (assuming the complete
program on the previous page is correct.)

Anonymous   
Printed Page 879
7th line

I think you forgot to define _syncRoot. I'm not finshed with testing the code, but I defined it as:

private object _syncRoot;

and then assigned the value in the "MyTcpServer" constructor, like

_syncRoot = this;

Anonymous   
898
1st paragraph (1st and 2nd line)

/// <returns>true if connected</returns>
public void Connect( )

!

Anonymous  Nov 24, 2010