Errata

C# 3.0 Cookbook

Errata for C# 3.0 Cookbook, Third Edition

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 18
3rd paragraph, last sentence

The sentence states: "For more on DataContext, see Recipe 1.6". Since this IS recipe 1.6, the pointer is obviously incorrect. I was unable to find what recipe it should be, so the sentence should probably be deleted.

Al Norman  Jul 07, 2009 
Printed Page 36
Last paragraph, 2nd to last line

Surrogate character is listed as value greater than 64K. I don't think that's correct. 64K is the
maximum unicode. Table 2-3 on page 39 has the correct values.

Anonymous   
Printed Page 42-46
Code examples

The variable 'int count' appears not to be used for any purpose in method FindAll().

Anonymous  Apr 21, 2009 
Printed Page 59
First code sample under "Solution"

The lines:

int actualInt = Int32.Parse(longString); // longString = 7654321

NumberStyles.AllowLeadingSign); // dblString = "-7654.321"

should probably look like this for clarity:

int actualInt = Int32.Parse(longString); // actualInt = 7654321

NumberStyles.AllowLeadingSign); // actualDbl = -7654.321

Anonymous  Apr 21, 2009 
Printed Page 183
Example 5-2

In the method
BinarySearchCountALL(T searchValue)
the line
while (left < 0 && this[left - 1].Equals(searchValue))
should yield:
while (left > 0 && this[left - 1].Equals(searchValue))

i.e. it needs to be "greater than" instead of "less than"

Christian Flury  Dec 01, 2010 
Printed Page 247
Sentence just before the "Discussion" heading

it says, "records the occurrence of a divide-by-zero exception". This should instead be an overflow
exception, based on the sample code.

Anonymous   
Printed Page 518
below "Solution" bold heading


It says "Construct a System.Net.Uri" object, but it should say "Construct a System.Uri" object.

The code later on works because the header is

Using System
Using System.Net

So, when a Uri is declared, it can find the reference in "System"

Anonymous  Aug 12, 2010 
Printed Page 620
upload file example

The "upload a file" example in the middle of page 620 never calls client.UploadFile().

Alan Esenther  Sep 30, 2009 
Printed Page 728
At the top of Example 18 - 3 Inside the method public void CallbackAsyncDelegate( )

The line that reads:

AsyncInvoke method1 = TestAsyncInvoke.Method1;

This seems to say the return type of Method1 is AsyncInvoke.

But the return type of Method1 is int:

public static int Method1( )
{
...method body
}

I get a compile time error as follows:

Error CS0029 Cannot implicitly convert type 'double' to 'FolderMonitor.AsyncInvoke' FolderMonitor C:\TomKnowlton_FolderMonitor\FolderMonitor\FolderMonitor\FolderInfoClass.cs 89 Active

Not sure how to resolve.

Thomas Knowlton  Oct 14, 2019 
Printed Page 801
FahrenheitToCelsius method

The first two code methods on this page are CelsiusToFahrenheit() and FahrenheitToCelsius().

The first method is correct and it multiplies by 1.8.
The second method is incorrect. It should either multiply by (5/9) which is less than 1.8 or divide by 1.8.

Anonymous