Microsoft KB Archive/314220

= Microsoft Visual C# .NET Step by Step Comments and Corrections =

Article ID: 314220

Article Last Modified on 7/2/2004

-

APPLIES TO


 * MSPRESS Microsoft Visual C# .NET Step by Step ISBN 0-7356-1289-7

-



This article was previously published under Q314220



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Microsoft Visual C# .NET Step by Step, ISBN 0-7356-1289-7.

The following topics are covered:


 * Page xi: Incorrect System Requirements
 * Page 9: Missing Word In Instructions
 * Page 16: Error In Step 7
 * Page 22: Error In Sample Code
 * Page 25: Your Name Should Be Enter Your Name In Step 8
 * Page 35: Errors In Step 5
 * Page 43: Error In Second Bullet Item
 * Page 46: Error In methodName Bullet
 * Page 51: Incorrect Text Regarding Variables
 * Page 57: readDouble Should Be readInt
 * Page 60: &quot;getInt&quot; Should Be &quot;readInt&quot;
 * Page 60: Error In Code Sample
 * Page 60: Error In Code Sample
 * Page 128: Typographical Error
 * Page 140: Missing Statement Regarding Const Field
 * Page 141: 'public static field' Should Be 'public static method'
 * Page 157: Stack Should Be Heap
 * Page 160: Incorrect Statement About Unboxing
 * Page 161: Incorrect Graphic
 * Pages 184 & 185: Lines Incorrectly Formatted As Code
 * Pages 193 And 194: Correction To ArrayList Code Sample
 * Page 199: Image Incorrectly Shows 12 Cards Per Player
 * Page 202: Correction In Step 3
 * Page 254: Incorrect Statement About Sealed Class
 * Page 268: Incorrect Statement About Initializing Properties
 * Page 274: Error In Step 11
 * Page 275: &quot;namespace Windows.Drawing&quot; Should Be &quot;namespace System.Windows.Drawing&quot;
 * Page 282: Incorrect Use of Vertical Ellipses In Code Sample
 * Page 292: &quot;Declare a read-only property&quot; Should Be &quot;Declare a read-only indexer&quot;
 * Page 305: Error In 'important' Block
 * Page 307: &quot;Ticker&quot; Should Be &quot;Ticker Class&quot;
 * Page 307: &quot;Attach and Remove&quot; Should Be &quot;Attach and Detach&quot;
 * Page 319: Error In Struct Vs. Class Box
 * Page 323: Error In Code Sample
 * Page 326: Error In Quick Reference Code Sample
 * Page 332: Incorrect Image
 * Page 333: Incorrect Image
 * Page 337: Incorrect Image
 * Page 347: Missing &quot; In Code Sample
 * Page 414: Image Should Not Include Cancel Button
 * Page 426: UserName Property Is Not Read-Only
 * Page 441: Duplicate Bullet In How To Box
 * Page 487: &quot;XSD&quot; Tags Should Be Changed To &quot;XS&quot;
 * Page 512: Label7 &quot;Label&quot; Property Should Be &quot;Text&quot;
 * Page 522: Typographical Error
 * Page 537: Correction In Step 7
 * Page 538: Authentication Mode Should Be Windows
 * Page 539: &quot;important&quot; Box Needs Additional Text
 * Page 565: Typographical Error



Page xi: Incorrect System Requirements
Page xi includes Windows XP Home Edition as part of the minimum system requirements. Windows XP Home does not include IIS, so does not meet the minimum requirements for this book. Windows XP Home Edition should be removed from page xi.

Page 9: Missing Word In Instructions
There is an error in the instructions on page 9.

Change:

&quot;On the Build menu, click Build.&quot;

To:

&quot;On the Build menu, click Build TextHello.&quot;

Page 16: Error In Step 7
There is an error in step 7 on page 16.

Change:

&quot; tags above the class to read&quot;

To:

&quot; tags within the class to read&quot;

Page 22: Error In Sample Code
There is an error in the code sample on page 22.

Change:

&quot;private System.Window.Forms.Button button1;&quot;

To:

&quot;private System.Windows.Forms.Button button1;&quot;

Page 25: Your Name Should Be Enter Your Name In Step 8
There is an error in step 8 at the top of page 25.

Change:

&quot;Type your name and then press Enter.&quot;

To:

&quot;Type Enter your name then press Enter.&quot;

Page 35: Errors In Step 5
There are two errors in step 5 on page 35.

Change:

&quot;select String.&quot;

To:

&quot;select string&quot;

Change:

&quot;the Sample Value box.&quot;

To:

&quot;the Sample value box.&quot;

Page 43: Error In Second Bullet Item
On page 43, in the second bullet,

Change:

&quot;If the 3 binds to the * operator, the result of the multiplication (3 * 4) forms the right hand operand of the / operator and the result of the whole expression is 2 / 12.&quot;

To:

&quot;If the 3 binds to the * operator, the result of the multiplication (3 * 2) forms the right hand operand of the / operator and the result of the whole expression 4 / (3 * 2), which is 0 (again integer division).&quot;

Page 46: Error In methodName Bullet
There is an error at the end of the second bullet on page 46.

Change:

&quot;start with a noun,&quot;

To:

&quot;start with a verb,&quot;

Page 51: Incorrect Text Regarding Variables
There is an error on page 51 regarding variables. Change:

&quot;Other statements in the method that come afterwards can use it when the method has finished, even though the variable disappears.&quot;

To:

&quot;The variable is created at the statement that defines it, and other statements in the method that come afterwards can use it. Once the method has finished, though, the variable disappears.&quot;

Page 57: readDouble Should Be readInt
On page 57, change step 5:

&quot;As before, verify that the readDouble method you have declared compiles without error.&quot;

To:

&quot;As before, verify that the readInt method you have declared compiles without error.&quot;

Page 60: &quot;getInt&quot; Should Be &quot;readInt&quot;
On page 60, in steps 8 and 11,

Change:

&quot;getInt&quot;

To:

&quot;readInt&quot;

Page 60: Error In Code Sample
There is an error in step 8 on page 60.

Change:

&quot;int noOfDays = readInt(&quot;Enter the no of days: &quot;):&quot;

To:

&quot;int noOfDays = readInt(&quot;Enter the number of days: &quot;):&quot;

Page 60: Error In Step 10
There is an error in step 10 on page 60.

Change:

&quot;The program displays the Enter The No Of Days prompt in the console window.&quot;

To:

&quot;The program displays the Enter the number of days prompt in the console window.&quot;

Page 128: Typographical Error
There is an error in the Abstract Data Types block. Change:

&quot;You cannot abstract these fields or methods...&quot;

To:

&quot;You cannot access these fields or methods...&quot;

Page 140: Missing Statement Regarding Const Field
On page 140, the &quot;Creating a Static Field...&quot; section is missing a statement.

Change:

&quot;... is nevertheless static. For example ...&quot;

To:

&quot;... is nevertheless static. However, for reasons beyond the scope of this book, you can only declare const field when the field is an enum, a primitive type, or a string. For example ...&quot;

Page 141: 'public static field' Should Be 'public static method'
There is an incorrect reference to a 'public static field' on page 141. Change:

&quot;Finally, you will write a public static field&quot;

To:

&quot;Finally, you will write a public static method&quot;

Page 157: Stack Should Be Heap
There is an eror in item 7 on page 157.

Change:

&quot;However, the memory acquired for the newly constructed Circle object is not released back to the stack.&quot;

To:

&quot;However, the memory acquired for the newly constructed Circle object is not released back to the heap.&quot;

Page 160: Incorrect Statement About Unboxing
There is an error in the first paragraph under Unboxing.

Change:

&quot;However, if you try this syntax, you'll get a compiletime error. Instead, you need to use the syntax object o = 42; where o refers to a boxed int containing the value 42. Here are examples:&quot;

To:

&quot;However, if you try this syntax, you'll get a compiletime error. For example:&quot;

Page 161: Incorrect Graphic
On page 161, the graphic at the top is missing some elements.

The arrow leading to the &quot;42&quot; box should come from a square &quot;@&quot; box with the label &quot;object o&quot; (exactly like the box at the bottom of page 159).

The arrow leading out of the &quot;42&quot; box should lead to a square &quot;42&quot; box with the label &quot;int i&quot; (exactly like the the box at the bottom of page 159).

Pages 184 & 185: Lines Incorrectly Formatted As Code
The last line on page 184, and the first two lines on 185 are incorrectly formatted as code. These lines are not part of the code sample at the bottom of page 184.

Pages 193 And 194: Correction To ArrayList Code Sample
On pages 193 and 194, in the code sample for ArrayList,

Change: ArrayList countdown = new ArrayList; ... countdown.Remove(7); ... countdown.RemoveAt(8); ... (the 4th element, index 5) ... the 7th element, index 8

To: ArrayList numbers = new ArrayList; ... numbers.Remove(7); ... numbers.RemoveAt(8); ... (the 4th element, index 3) ... the 7th element, index 6

Page 199: Image Incorrectly Shows 12 Cards Per Player
The image on page 199 shows 12 cards per player. This image should show 13 cards per player.

Page 202: Correction In Step 3
On page 202, in step 3,

Change:

&quot;A foreach statement is okay here because you do need...&quot;

To

&quot;A foreach statement is okay here because you do not need...&quot;

Page 254: Incorrect Statement About Sealed Class
On page 254, in the first bulleted item under &quot;Notice that:&quot;,

Change:

&quot;(The extension would also be valid if TextReader were a sealed class.)&quot;

To:

&quot;(The extension would also be invalid if TextReader were a sealed class.)&quot;

Page 268: Incorrect Statement About Initializing Properties
On page 268, in the first bullet,

Change:

“You can't initialize a property through a set accessor...&quot;

To:

“You can't initialize a property of a struct using a set accessor...”

Page 274: Error In Step 11
There is an error in step 11 on page 274.

Change all instances of:

&quot;Windows.System.Forms.Form&quot;

To:

&quot;System.Windows.Forms.Form&quot;

Page 275: &quot;namespace Windows.Drawing&quot; Should Be &quot;namespace System.Windows.Drawing&quot;
On page 275, in the code sample,

Change:

&quot;namespace Windows.Drawing&quot;

To:

&quot;namespace System.Windows.Drawing&quot;

Page 282: Incorrect Use of Vertical Ellipses In Code Sample
On page 282, the code sample incorrectly uses vertical ellipses. Change these two instances to horizontal ellipses (...).

The code sample should appear as follows:

{   ...    public bool this [ int index ] {       get { ... }       set { ... }   }    ... }

Page 292: &quot;Declare a read-only property&quot; Should Be &quot;Declare a read-only indexer&quot;
On page 292,

Change:

&quot;Declare a read-only property&quot;

To:

&quot;Declare a read-only indexer&quot;

Page 305: Error In 'important' Block
There is an error in the 'important' block on page 305.

Change:

&quot;when a delegate is attached to it by using the -=operator.&quot;

To:

&quot;when a delegate is attached to it by using the +=operator.&quot;

Page 307: &quot;Ticker&quot; Should Be &quot;Ticker Class&quot;
There is an error in step 2 on page 307.

Change:

&quot;locate the Ticker in the&quot;

To:

&quot;locate the Ticker class in the&quot;

Page 307: &quot;Attach and Remove&quot; Should Be &quot;Attach and Detach&quot;
There is an error in step 4 on page 307.

Change:

&quot;delete the Attach and Remove methods&quot;

To:

&quot;delete the Attach and Detach methods&quot;

Page 319: Error In Struct Vs. Class Box
On page 319, there is an error at the bottom of the Struct vs. Class box. The last line, &quot;This is for efficiency reasons...&quot;, should be deleted entirely.

Page 323: Error In Code Sample
There is an error in the code sample at the bottom of page 323.

Change: public static implicit operator int (Hour from) {    return from.value; } To: public static implicit operator Hour (int from) {    return new Hour(from); }

Page 326: Error In Quick Reference Code Sample
There is an error in the &quot;Declare an operator&quot; section on page 326.

Change:

&quot;public static operator==(Hour lhs, Hour rhs)&quot;

To:

&quot;public static bool operator==(Hour lhs, Hour rhs)&quot;

Page 332: Incorrect Image
The image on page 332 is incorrect. It should show a system Color Picker panel.

Page 333: Incorrect Image
The image on page 333 is incorrect. It should show an empty project window with the Bell Ringers logo background.

Page 337: Incorrect Image
The image on page 337 is incorrect. It should show a code overview window.

Page 347: Missing &quot; In Code Sample
The code sample on page 347 is missing two &quot; marks.

Change: details = &quot;Member name &quot; + firstName.Text + &quot; + lastName.Text + from the tower at &quot; + tower.Text; To: details = &quot;Member name &quot; + firstName.Text + &quot; &quot; + lastName.Text + &quot; from the tower at &quot; + tower.Text;

Page 414: Image Should Not Include Cancel Button
The image on page 414 is incorrect. It should not include a Cancel button.

Page 426: UserName Property Is Not Read-Only
There is an error at the end of Step 5 on page 426.

Change:

&quot;You do not want the UserName property to appear because it is read-only.&quot;

To:

&quot;You do not want the UserName property to appear because it is write-only.&quot;

Page 441: Duplicate Bullet In How To Box
The first and second bullet items at the top of page 441 are duplicates.

The second bullet should read:

&quot;Retrieve data from a database and browse it graphically in Visual Studio.NET&quot;

Page 487: &quot;XSD&quot; Tags Should Be Changed To &quot;XS&quot;
All &quot;XSD&quot; tags in the Step 15 code sample should be changed to &quot;XS&quot;.

Page 512: Label7 &quot;Label&quot; Property Should Be &quot;Text&quot;
There is an error in the table at the bottom of page 512. The Properties for Label 7 should be changed from:

&quot;Label

Height

Width

(ID)&quot;

To:

&quot;Text

Height

Width

(ID)&quot;

Page 522: Typographical Error
There is a typographical error in the second Quick Reference item.

Change:

&quot;definitoin&quot;

To:

&quot;definition&quot;

Page 537: Correction In Step 7
On page 537, in step 7, change:

private void loginClick(object sender, System.EventArgs e) {

To:

private void loginButtonClick(object sender, System.EventArgs e) {

Page 538: Authentication Mode Should Be Windows
There is an error in Step 2 on page 538.

Change: &quot;Locate the tag. It will indicate that security has not yet been implemented: &quot;

To: &quot;Locate the tag. It will indicate that Windows authentication is being used: &quot;

Page 539: &quot;important&quot; Box Needs Additional Text
The &quot;important&quot; box on page 539 needs to have the following text added to the end:

&quot;If you have installed and configured the QuickStart samples, the account used by ASP.NET will already have been granted access to the Northwind database. If you have not already installed the QuickStart samples you can grant access to the ASP.NET service using the steps shown below.&quot;

Page 565: Typographical Error
There is a typographical error in step 4 on page 565.

Change:

&quot;Cick the Auto Format hyperlink ...&quot;

To:

&quot;Click the Auto Format hyperlink ...&quot;

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.

Additional query words: 0-7356-1289-7 SHARP JAGGER EUBOOK EUSBS VSTUDIO .NET VC

Keywords: kbinfo kbdocfix kbdocerr KB314220

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.