Technical Errata for "Professional ASP.NET" Special Edition

(.NET 1.0 update version -  Wrox Press ISBN:1-861007-03-5 )

Chapter 1

Page 24, code section: the runat="server" attribute should not appear twice in the declaration of the asp:Button control.

Chapter 3

Pages 91, 94 and 95, code sections: in several places, the "double-quote" characters have erroneously been replaced during the printing process by two "double-quote" characters.

Chapter 4

Page 144-145, code section: the <html> and <head> tags should be should be after </script> and before <form>, and followed by </head><body>. There should be a </body> tag between </form> and </html>.

Page 161, first code section, line 4: Missing closing bracket - should read:

"If Len(Request.Params("ProductCode")) > 0 Then". Also in repeat of code on page 162.

 

Page 152, table. There is an error in the attribute list for the @Page directive. The property name to enable or disable tracing is Trace, not TraceEnabled.

Chapter 6

Page 247, table. The event for the CheckBox and RadioButton controls should read "OnCheckedChanged" not "OnCheckChanged".

281, screenshot. Unfortunately the screenshot was re-taken just before printing, and the wrong value used in the DataTextFormatString textbox. It should be "Bid: {0:C}" not  "Bid: [0:C]". The correct screenshot is:

 

Chapter 7

Page 313, last but one paragraph, last line. Should read "...doesn't set the value attribute of each one".

Chapter 8

Pages 390-391. After publication, an automated set-up routine was added to the downloadable samples. The file connect-strings.ascx is different in this download, and does not need to be edited to specify the connection strings. Instead, they are specified in the appSettings section of the web.config file in the root folder of the samples. The set-up routine expects to find an instance of MSDE named .NetSDK (as provided with the .NET SDK). You can edit the connection strings in the appSettings section of web.config to specify a different database server or MSDE instance if required.

Page 395, second paragraph (SingleResult). Last sentence should be: "Alternatively, use the ExecuteScalar method of the Command object." (not DataReader object).

Chapters 8 - 10

Many of the data access examples use parameter names that are not prefixed by the "@" symbol when adding parameters to the ParametersCollection. This works fine when using the OleDb data access classes, because parameters are passed by position and not by name (as was the default with ADO prior to ADO.NET). In fact, any name can be used for the parameters - the names don't have to match the parameter names in the stored procedure. However, if you use the SqlClient classes, the parameters are passed by name, and so all parameter names must be prefixed by "'@" in this case.

Chapter 11

Page 571, first code section, line 2: replace "objXTReader.Read()" with " objXTReader.ReadString()" and change first line of preceding paragraph from "...call the Read method..." to "...call the ReadString() method..."

Page 549, table, InferXmlSchema method definition. Should start "Takes an XML document provided in..." (not a schema)

Chapter 12

Page 602, last code section, the lines...

  myCommand = New SqlDataAdapter(sql, myConnection)

  myConnection = New SqlConnection(dsn)

...should be reversed to read...

  myConnection = New SqlConnection(dsn)

  myCommand = New SqlDataAdapter(sql, myConnection)

Page 602, last code section, highlighted section should read:

  <add verb="*" path="*.jpg"

           type="System.Web.UI.PageHandlerFactory" />

Chapter 13

Page 698: Should include the following note immediately prior to the XML excerpt from the machine.config file:

Note, an important but subtle change in the final released version of ASP.NET is the Windows identity that the ASP.NET worker process runs as. In previous beta versions it was the 'System' account. The final version uses a special Windows account created when the .NET Framework is installed: aspnet. For more details on the implications of these changes please see the chapter on security. This of course is still configurable using the username/password attributes of the <processModel ...> settings.

 

Page 699: userName="SYSTEM" should be userName="machine"

 

Page 700: userName="" password=""

Should be: userName="machine" password="autogenerate"

 

Page 703: userName="" password=""

Should be: userName="machine" password="autogenerate"

 

Page 705: 'By default it is the System account' should read:

'By default, it is a restricted Windows account ASPNET'.

Also: 'by using these settings we can instruct the process to execute under

another Windows identity.' should read:

'by using these settings we can instruct the process to execute under

another Windows identity, or the System  account.'

 

Page 706: 'we see that the process is executing as user ASPNET_WP rather than SYSTEM.'

should read: 'we see that the process is executing as user ASPNET_WP rather than aspnet.'

 

Page 706: The following note should be included immediately before the 'Logging

Process Events':

To run as the system account, as previous Beta versions of ASP.NET did, we

simply change the username/password  to the following values:

userName="System" password="AutoGenerate"

Chapter 14

Page 730, second set of bullets, first two should be replaced by this one bullet: "The request is made under the context of the special ASPNET process account, irrespective of whether anonymous access is enabled or not in IIS" ...[when impersonation is not enabled].

Chapter 15

Page 784, last paragraph: in the sentence "All arrays implement the IEnumerator interface..." replace IEnumerator with IEnumerable.

Page 807. The default behaviour of the HashTable object has changed from Beta 2, and it will now throw an exception if the Key object is considered to match an existing Key object that is in use for an existing item in a HashTable. However, the remainder of the text concerning the behavior of the HashTable object is correct.

Page 820, last paragraph before code section: should read "...setting bits 0, 1 and 6..."

Chapter 22

Page 1198, the wrong screenshot was included at the foot of the page. The correct one is:

 

Chapter 23

Page 1251, the C# code at the bottom of the page should be:

  [StructLayout(LayoutKind.Sequential)]

  public class SystemTime

  {

    public short wYear;

    public short wMonth;

    public short wDayOfWeek;

    public short wDay;

    public short wHour;

    public short wMinute;

    public short wSecond;

    public short wMilliseconds;

  }

  public class API

  {

    [DllImport("Kernel32.dll")]

    public static extern void GetSystemTime(

    [Out, MarshalAs(UnmanagedType.LPStruct)]SystemTime sysTime);

  }

Page 1252, the first code section should be:

  SystemTime st = new SystemTime();

  API.GetSystemTime(st);

  Response.Write("Month = " + st.wMonth);