Microsoft KB Archive/810633

= Microsoft ASP .NET Programming With Microsoft Visual C# .NET Deluxe Learning Edition Comments and Corrections =

Article ID: 810633

Article Last Modified on 8/13/2003

-

APPLIES TO


 * MSPRESS Microsoft ASP.NET Programming with Microsoft Visual C# .NET Deluxe Learning Edition, ISBN 0-7356-1815-1

-



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Microsoft ASP .NET Programming With Microsoft Visual C# .NET Deluxe Learning Edition, ISBN 0-7356-1815-1.

The following topics are covered:
 * Page 13: Incorrect Path
 * Page 68: Quotations Replaced By Question Marks
 * Page 70: Quotations Replaced By Question Marks
 * Page 71: Quotations Replaced By Question Marks
 * Page 72: Quotations Replaced By Question Marks
 * Page 82: Ellipsis Replaced By Question Mark
 * Page 88: Quotations Replaced By Question Marks
 * Page 91: Quotations Replaced By Question Marks
 * Page 99: Error In Code Sample
 * Page 121: Error In Code Sample
 * Page 202: Incorrect Language
 * Page 231: Incorrect Statement
 * Page 288: Typographical Error
 * Page 316: Typographical Error
 * Page 358: Incorrect References To Visual Basic.NET
 * Page 360: Error In Code Sample
 * Page 370: Typographical Error
 * Page 371: Error In Code Sample
 * Page 374: Incorrect Text In Note Box
 * Page 375: Error In Code Sample
 * Page 375: Typographical Error
 * Page 421: Error In Code Sample



Page 13: Incorrect Path
There is an incorrect path at the bottom of page 13.

Change:

&quot;C:\aspnetsbs&quot;

To:

&quot;C:\MS Press Books\ASPNETSBS_CS&quot;

Page 68: Quotations Replaced By Question Marks
On page 68, in the second code sample, the quotation marks in the Response.Write statement have been replaced by question marks.

Change: Response.Write(?Error! Division by 0 requested!?);

To: Response.Write(&quot;Error! Division by 0 requested!&quot;);

Page 70: Quotations Replaced By Question Marks
On page 70, in the code sample, the quotation marks in the Response.Redirect statement have been replaced with question marks.

Change:

if ( Session[?LoggedInUserName?] == ?? && )

{

Response.Redirect(?Login.aspx?);

} To: if ( Session[&quot;LoggedInUserName&quot;] == ?? && )

{

Response.Redirect(&quot;Login.aspx&quot;);

}

Page 71: Quotations Replaced By Question Marks
On page 71, in both code samples, several quotation marks have been replaced with question marks in both code samples.

For the code sample in the middle of the page, change:

if ( Session[?LoggedInUserName?] == ?? && Tries!=7 ) {   Response.Redirect(?Login.aspx?); } To:

if ( Session[&quot;LoggedInUserName&quot;] == ?? && Tries!=7 ) {   Response.Redirect(&quot;Login.aspx&quot;); }

And for the sample at the bottom of the page, change:

if ( Session[?LoggedInUserName?] == ?? && Tries!=7 ) Response.Redirect(?Login.aspx?); To: if ( Session[&quot;LoggedInUserName&quot;] == ?? && Tries!=7 ) Response.Redirect(&quot;Login.aspx&quot;);

Page 72: Quotations Replaced By Question Marks
In the lower code sample on page 72, several quotation marks have been replaced with question marks. Some of the indentation also needs to be adjusted.

Change: if ( Session[?LoggedInUserName?] == ?? ) { Response.Redirect(?Login.aspx?); } else { if ( Session[?LoggedInUserName?] == ?SuperUser? ) { Response.Write(?You are a superuser!?): } else { Response.Write(?Hello, ? + Session[?LoggedInUserName?] + ?!?); } } To:

if ( Session[&quot;LoggedInUserName&quot;] == ?? ) {       Response.Redirect(&quot;Login.aspx&quot;); } else } if ( Session[&quot;LoggedInUserName&quot;] == &quot;SuperUser&quot; ) {       Response.Write(&quot;You are a superuser!&quot;): } else {       Response.Write(&quot;Hello, &quot; + Session[&quot;LoggedInUserName&quot;] + &quot;!&quot;); } }

Page 82: Ellipsis Replaced By Question Mark
On page 82, in the code sample for Using do...while Loops, change the first line of the sample:

// Do?While syntax: To:

// Do...While syntax

Page 88: Quotations Replaced By Question Marks
On page 88, in step 11, the quotation marks have been replaced with question marks in the next to final line of sample code.

Change: Message.Text=?Cannot divide by 0!?; To: Message.Text=&quot;Cannot divide by 0!&quot;;

Page 91: Quotations Replaced By Question Marks
On page 91, in the first code sample, the quotation marks have been replaced with question marks in the Console.WriteLine statement.

Change: public class Animal {  public virtual void Eat {   Console.WriteLine(?Yum!?); }  public virtual void Sleep {   Console.WriteLine(?Zzzzz??); } } To: public class Animal {  public virtual void Eat {   Console.WriteLine(&quot;Yum!&quot;); }  public virtual void Sleep {   Console.WriteLine(&quot;Zzzzz?&quot;); } }

Page 99: Error In Code Sample
There is an incorrect comment character used in the code sample on page 99. The sample should read:

// Global.asax 

// Web Forms page Response.Write(&quot;Value = &quot; & MyClassInstance.MyValue)

Page 121: Error In Code Sample
There is an error in the web.config sample on page 121. One of the elements in this file contains an extra &quot;/&quot; in its opening tag. The code sample should read:

 

Page 202: Incorrect Language
The incorrect programming language is used at the top of page 202. The two code samples are written in VB.NET syntax, when they should be C#. The corrected code samples should read:

MailMessage myMail = new MailMessage;

and

MailMessage myMail = new System.Web.Mail.MailMessage;

Page 231: Incorrect Statement
Step 7 on page 213 contains a Note which refers to Visual Basic. The following line should be removed:

(Note that the following code is a single line, but uses the Visual Basic line continuation character for readability.)

Page 288: Typographical Error
There is a typo in Step 6. Step 6 should read:

Add the following using clause to the top of the source file:

using System.Data.SqlClient;

Page 316: Typographical Error
There is a typo in step 11 on page 316.

Change:

&quot;types dataset&quot;

To:

&quot;typed dataset&quot;

Page 358: Incorrect References To Visual Basic.NET
There are two instances of Visual Basic.NET in the second paragraph on page 358. These should each be changed to Visual C# .NET.

The reference to Visual Basic.NET in the &quot;important&quot; note should also be changed to Visual C# .NET.

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

Change:

base.Render(output)

To:

base.Render(output);

Page 370: Typographical Error
There is a typo in the text of Step 2. The corrected text should read:

&quot;Add the following code to the top of the file, just below the curly brace below the namespace keyword. The code creates an enumeration that defines the allowable values of the property you’re going to add:&quot;

Also, the code sample in Step 2 contains an extra closing curly brace. The final curly brace in the sample should be removed.

Page 371: Error In Code Sample
There is a missing a closing curly brace ( } ) in code sample in step 1. The code sample should read:

protected void FormatText {               switch(textType) {                       case TextTypes.CurrencyText: this.Text=(double.Parse(this.Text)).ToString(&quot;C&quot;); break; case TextTypes.DecimalText: this.Text=(Convert.ToInt32(this.Text)).ToString(&quot;F&quot;); break; }       }

Page 374: Incorrect Text In Note Box
There are multiple errors in the Note box at the top of page 374. The text should read:

&quot;You implement interfaces in the fashion specified by the language you’re using. As shown earlier, interfaces are implemented in Visual C# .NET using the same syntax used to inherit from a base class:

class MyClass : System.Web.UI.Control, IPostBackDataHandler,

IpostBackEventHandler

Unlike inheritance, which allows inheriting only from a single base class, you can implement as many interfaces as you’d like. The first name following the colon above indicates a class, while the next two are interfaces. Separate each interface name with a comma, as shown above.&quot;

Page 375: Error In Code Sample
There is an error in the code sample at the top of page 375. The code should read:

public event EventHandler EventName

The paragraph following the code sample is also incorrect. The paragraph should read:

&quot;EventName is the name of the event being created. Notice that the event is declared as type EventHandler.&quot;

Page 375: Typographical Error
There is a typo in the first paragraph following the note box. The paragraph should read:

&quot;Next, you raise the event (based on the criteria you set up within your control to determine if the event should be called) by calling the event name as follows:&quot;

Page 421: Error In Code Sample
There is an error in the example WebService attribute declaration at the bottom of page 421. The declaration contains an erroneous Visual Basic line continuation character.

Change:

[WebService(Namespace=&quot;http://www.aspnetsbs.com/webservices/&quot;)] _ public class ClassName

To:

[WebService(Namespace=&quot;http://www.aspnetsbs.com/webservices/&quot;)] public class ClassName

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: EUBOOK VSTUDIO 0-7356-1815-1

Keywords: kbdocfix kbdocerr KB810633

-

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

© Microsoft Corporation. All rights reserved.