Microsoft KB Archive/326884

= MCAD/MCSD Self-Paced Training Kit: Developing Web Applications with Microsoft Visual Basic .NET and Microsoft Visual C# .NET Comments and Corrections =

Article ID: 326884

Article Last Modified on 3/18/2004

-

APPLIES TO


 * MSPRESS MCAD/MCSD Self-Paced Training Kit Developing Web Applications With Microsoft Visual Basic.Net And Microsoft Visual C#.Net, ISBN 0-7356-1584-5

-



This article was previously published under Q326884



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book MCAD/MCSD Self-Paced Training Kit: Developing Web Applications with Microsoft Visual Basic .NET and Microsoft Visual C# .NET, ISBN 0-7356-1584-5.

The following topics are covered:


 * CD-ROM: Test Engine Uninstall Disables Visual Studio .NET Functionality
 * Page xxix: Change To Command Line Path
 * Page 13: Common Should Be Component
 * Page 51: Localhost Should Be Default Web Site
 * Page 56: Correction To Table 2-1
 * Pages 62 & 63: Error In Code Samples
 * Page 74: Incorrect Tip On Control Array Creation
 * Page 78: Incorrect Code Module Name
 * Page 78: Incorrect Declaration
 * Page 79: Step 4 Needs Additional Instructions
 * Page 91: Four Should Be Five
 * Page 101: Depth Should Be Front
 * Page 109: Duplicate Line And Missing Code
 * Page 116: Extra Set Of Parenthesis In Visual C# Code Sample
 * Page 119: Response Should Be Request
 * Page 124: Correction To sessionState
 * Page 130: Translator Should Be TranslatorClass
 * Page 144: DropDown list Should Be DropDownList
 * Pages 145-146: Visual C# Code Sample Replacement
 * Page 198: New Should Be Save
 * Page 207: SqlDbConnection Should Be SqlConnection
 * Page 209: Figure 5-2 Incorrect
 * Page 210: Correction To Step 5
 * Page 295: False Should Be True



CD-ROM: Test Engine Uninstall Disables Visual Studio .NET Functionality
An error has been discovered that occurs when you uninstall the developing Web/Win apps test engine. You are left unable to open a new project in Visual Studio, with an error that Automation Server Can't Create Object.

The workaround is to re-register the windows/system32/scrrun.dll file with the following steps:


 * 1) Open the command prompt.
 * 2) Change directory to windows\system32: Type cd\windows\system32 and press enter.
 * 3) Verify that the scrrun.dll file is in the system32 directory: Type dir scrrun* and press enter. The file name should be displayed.
 * 4) You now need to register scrrun.dll: Type regsvr32 scrrun.dll and press enter. You should get a message that the registration was successful.

You should now be able to open a new project in Visual Studio.

Page xxix: Change To Command Line Path
On page xxix, in step 3 of setting up the lesson files, the command line sample should be changed from the D: drive to the C: drive to match the previous steps.

Change:

&quot;D:\MCSDWebApps> makeVirtualDirectories D:\MCSDWebApps&quot;

To:

&quot;C:\MCSDWebApps> makeVirtualDirectories C:\MCSDWebApps&quot;

Page 13: Common Should Be Component
On page 13, in the last sentence of the first paragraph,

Change:

&quot;Common Object Model (COM)&quot;

To:

&quot;Component Object Model (COM)&quot;

Page 51: Localhost Should Be Default Web Site
On page 51, in step 1,

Change:

&quot;1. Right-click the localhost icon in IIS and ...&quot;

To:

&quot;1. Right-click the Default Web Site icon in IIS and ...&quot;

Page 56: Correction To Table 2-1
On page 56, in Table 2-1,

Change:

AssmblyInfo. AssemblyInfo.csvb

To:

AssmblyInfo.vb AssemblyInfo.cs

Pages 62 & 63: Error In Code Samples
On page 62, in the Visual Basic .Net code sample line 9, change: ' Display Session count. To: ' Display Application count.

and in the Visual C# code sample, first line on page 63, change:

// Display Session count. To: // Display Application count.

Page 74: Incorrect Tip On Control Array Creation
In the Tip box on page 74, it is incorrectly stated that &quot;In Web forms, this does not create a control array as it does in Windows forms.&quot; This sentence should be removed as it applies to VB 6.0, not VB.NET.

In Visual Basic .NET, control arrays are no longer supported. Changes to the event model make control arrays unnecessary. Just as control arrays in Visual Basic 6.0 could share events, the event model in Visual Basic .NET allows any event handler to handle events from multiple controls. In effect, this allows you to create groups of controls of disparate types that share the same events.

More details on this can be found on the Microsoft Developer Network at

Page 78: Incorrect Code Module Name
On page 78, in step 1 of exercise 4, you are instructed to open the Web form's code module FlashCard.aspx.vb. This is only correct for the Visual Basic version of the code.

Change:

&quot;FlashCard.aspx.vb&quot;

To:

&quot;FlashCard.aspx&quot;

Page 78: Incorrect Declaration
On page 78, in step 2, the Visual Basic declaration needs to be changed from: Dim FlashCard As FlashCardClass

To: Dim FlashCard As New FlashCardClass

Page 79: Step 4 Needs Additional Instructions
On page 79, step 4, add the following as the first sentence to the instruction:

&quot;In the project window, double-click the FlashCard.aspx file and then double click the textbox.&quot;

Page 91: Four Should Be Five
On page 91, in the third paragraph,

Change:

&quot;Visual Basic .NET and Visual C# use four key concepts...&quot;

To:

&quot;Visual Basic .NET and Visual C# use five key concepts...&quot;

Page 101: Depth Should Be Front
On page 101, in the Visual Basic code sample, 13 lines from the top of page, change:

Depth = sCenter - Radius

To:

Front = sCenter - Radius

Page 109: Duplicate Line And Missing Code
On page 109, in the Visual C# code sample, a line has been duplicated (lines 12 and 13), and the correct line of code is missing for line 13.

Change:

ShowShapeInfo(MySphere); ShowShapeInfo(MySphere);

To:

ShowShapeInfo(MySphere); ShowShapeInfo(MyCircle);

Page 116: Extra Set Of Parenthesis In Visual C# Code Sample
On page 116, in the Visual C# code sample,

Change: if ((Request.Cookies[&quot;UName&quot;] != null))

To: if (Request.Cookies[&quot;UName&quot;] != null)

Page 119: Response Should Be Request
On page 119, under &quot;Visual C#&quot;,

Change:

&quot;To retrieve a query string in code, use the QueryString method of the Response object.&quot;

To:

&quot;To retrieve a query string in code, use the QueryString method of the Request object.&quot;

Page 124: Correction To sessionState
On the bottom of page 124, the sessionState tag is incorrect.

Change:

&quot;&quot;

To:

&quot;&quot;

Page 130: Translator Should Be TranslatorClass
On page 130, in the Visual C# code sample in Exercise 3, change:

Translator TransClass = new TranslatorClass;

To:

TranslatorClass TransClass = new TranslatorClass;

Page 144: DropDown list Should Be DropDownList
On page 144, in the paragraph following the Visual C# sample code,

Change:

&quot;Both the ListBox and DropDown list&quot;

To:

&quot;Both the ListBox and DropDownList&quot;

Pages 145-146: Visual C# Code Sample Replacement
The Visual C# code sample on pages 145-146 needs to be replaced with the following code:

private void butAdd_Click(object sender,        System.EventArgs e)    { ListBox1.Items.Add(txtSource.Text); DropDownList1.Items.Add(txtSource.Text); // Add text to the page's ViewState. ViewState.Add(ViewState.Count.ToString, txtSource.Text); RebuildTable; }

private void RebuildTable {       string[] arrWords; string strWords; TableRow rowNew; TableCell celNew; // For each string saved in ViewState. for (int iCount1 = 0; iCount1 < ViewState.Count;            iCount1++) {       char[] strSep = {','}; // Create a new table row. rowNew = new TableRow; // Get the string from ViewState. strWords = ViewState[iCount1.ToString].ToString; // Break the item list into an array. arrWords = strWords.Split(strSep); // For each item in the array. for (int iCount2 = 0; iCount2 <= arrWords.GetUpperBound(0); iCount2++) {           // Create a new table cell. celNew = new TableCell; // Set the text to display in the cell. celNew.Text = arrWords[iCount2]; // Add the cell to the table row. rowNew.Cells.Add(celNew); }       // Add the row to the table. Table1.Rows.Add(rowNew); } }

Page 198: New Should Be Save
On page 198, in step 5, the button name is erroneously named as New.

Change:

&quot;...and double-click New to display the Code window.&quot;

To:

&quot;...and double-click Save to display the Code window.&quot;

Page 207: SqlDbConnection Should Be SqlConnection
On page 207, in the second bulleted item,

Change:

&quot;SqlDbConnection&quot;

To:

&quot;SqlConnection&quot;

Page 209: Figure 5-2 Incorrect
On page 209, Figure 5-2 does not illustrate the correct dialog box referred to in step 2 under &quot;Connecting to a Database&quot; on page 208. Please disregard this figure.

Page 210: Correction To Step 5
On page 210, step 5 needs to be changed to read:

&quot;As shown in figure 5-3, enter (local)\NETSDK as the server name and use Windows NT Integrated Security. Select &quot;Attach a database file as a database name&quot;, and enter Contacts in the first field and for the second field browse to the Contacts.mdf file (it should be located at C:\MCSDWebApps\Chapter05\Contacts.MDF). Click Test Connection to make sure your settings are correct. Click Ok when the connection succeeds. Visual Studio adds the data connection to the Server Explorer, as shown in figure 5-4.&quot;

Page 295: False Should Be True
On page 295, in the second bullet,

Change:

&quot;To turn tracing on for a single page, set the DOCUMENT object's Trace property to False&quot;

To:

&quot;To turn tracing on for a single page, set the DOCUMENT object's Trace property to True&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: TKBOOK VSTUDIO VB VC .NET 0-7356-1584-5 Webb

Keywords: kbinfo kbdocfix kbdocerr KB326884

-

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

© Microsoft Corporation. All rights reserved.