Microsoft ASP .NET Programming With Microsoft Visual C# .NET Deluxe Learning Edition Comments and Corrections (810633)



The information in this article 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

MORE INFORMATION

Page 13: Incorrect Path

There is an incorrect path at the bottom of page 13.

Change:
"C:\aspnetsbs"

To:
"C:\MS Press Books\ASPNETSBS_CS"

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("Error! Division by 0 requested!");

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["LoggedInUserName"] == ?? &&  )

{

	Response.Redirect("Login.aspx");

}

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["LoggedInUserName"] == ?? && Tries!=7 )
{
	Response.Redirect("Login.aspx");
}

And for the sample at the bottom of the page, change:
if ( Session[?LoggedInUserName?] == ?? && Tries!=7 )
	Response.Redirect(?Login.aspx?);
To:
if ( Session["LoggedInUserName"] == ?? && Tries!=7 )
	Response.Redirect("Login.aspx");

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["LoggedInUserName"] == ?? )
    {
        Response.Redirect("Login.aspx");
    }
else
}
if ( Session["LoggedInUserName"] == "SuperUser" )
    {
        Response.Write("You are a superuser!"):
    }
else
    {
        Response.Write("Hello, " + Session["LoggedInUserName"] + "!");
    }
}

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="Cannot divide by 0!";

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("Yum!");
   }
   public virtual void Sleep()
   {
	Console.WriteLine("Zzzzz?");
   }
}

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
<object runat="server" id="MyClassInstance" class="MyClassName"
   scope="Application">
</object>

// Web Forms page
Response.Write("Value = " & 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 "/" in its opening tag. The code sample should read:
<elementName2
   attributeName1=value
   attributeName2=value
   attributeNameN=value>
</elementName2>

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:
"types dataset"

To:
"typed dataset"

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 "important" 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:

"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:"

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("C");
                                break;
                        case TextTypes.DecimalText:
                                this.Text=(Convert.ToInt32(this.Text)).ToString("F");
                                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:

"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."

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:

"EventName is the name of the event being created. Notice that the event is declared as type EventHandler."

Page 375: Typographical Error

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

"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:"

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="http://www.aspnetsbs.com/webservices/")] _ public class ClassName

To:
[WebService(Namespace="http://www.aspnetsbs.com/webservices/")] 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.

Modification Type:MinorLast Reviewed:8/13/2003
Keywords:kbdocfix kbdocerr KB810633 kbAudEndUser