MCAD/MCSD Training Guide (70-316): Developing and Implementing Windows-based Applications with Visual C# and Visual Studio .NET (First Edition) by Amit Kalani 

Errata 

(You can help! If you know an error not mentioned in this list, please report the error)

Last Update: June 11, 2004

Chapter

Page

Error Description

Reported By

1 36 In Step By Step 1.1, Step 3, change the second sentence to the following:
Text in the title bar can be manipulated through the Text property of the form.
Caroline Bogart
1 37 Figure 1.7 should display form StepByStep1_1 instead of Form1 Mark G.
1 68 Second bulleted point. Change the second sentence to:
The this keyword qualifies it for the current instance of the form.
Dan Maltes
1 87 In Step by Step 1.17, Step 4, change the name of variable penYellow to penBlue Mark G.
1 93 In Step By Step 1.19, Step 4, I use a file named sunset.jpg. Make sure that this file exist in the same directory as the exe file when you run the application. If you want to use a different file, please change the code accordingly. Mark G.
1 94 Section "Working with Images". Read the second sentence as:
However, the Image class is abstract, which means you cannot create an instance of it in your class.
Dan Maltes
1 101 In the Key Terms element, replace GDI or GDIT with GDI+ Geoff Bishop
1 102 In Exercise 1.1, in Step 4, 5 and, 7, change text to sbText Dan Maltes / Peter George
1 110 Answer to Question 9. change GraphicsFrom.Hwnd() to Graphics.FromHwnd() Jacques Lacerte
2 126 In Step By Step 2.3, Step 3, remove the quotation mark before the &Master's degree. Caroline Bogart
2 133 In Guided Practice Exercise 2.1, append the following sentence to Step 4:
Change the DropDownStyle property of cboControls to DropDownList
Caroline Bogart
2 139 In Step By Step 2.6, Step 2, change ShowIntaskBar to ShowInTaskbar, and change False to false. Geoff Bishop
2 157 In Step By Step 2.10, Step 3, change the text "Change the ListBox control's Text property..." to "Change the ListBox control's Name property..." Jason Pursell
2 158 In Step By Step 2.10, Step 5, change the first sentence to:
Invoke the Properties window for the clbScripts control and click the Events icon.
Thom Little
2 161 In Step By Step 2.11, change the first sentence of the Step 3 to the following:
For the cboColor control, change the Sorted property to true and the DropDownStyle property to DropDownList. Add the following names to the items collection via the String Collection Editor:
Caroline Bogart
2 162 In Guided Practice Exercise 2.2, step 3, append the following sentence:
Change the ComboBox control's ItemHeight property to 25.
 
Jason Pursell
2 175 In Step By Step 2.14, Step 5, change the using directive to:
using System.IO;
Ian Duncan
2 178 In Table 2.21, the member ValueChanged is of the type Event rather than Property Jacques Lacerte
2 179 In Step By Step 2.15, Change the Step 5 as shown here:
5. Name a Label control lblMessage. Use another Label control to represent a line by changing its Size-Height property to 1 and its BorderStyle property to Fixed3D.
Ian Duncan/ Caroline Bogart
2 184 In Step By Step 2.17, Step 3, change rbOKCCancel to rbOKCancel Thom Little
2 190 In Step By Step 2.18, Step 3, change rbText to rtbText. Ian Duncan
2 196 In Step By Step 2.18, after Step 24, add the following using directive to the code of frmAbout form:
using System.IO;
Royce Fickling
2 198 In Table 2.30, change the Control Name item, mnuContextpaste to mnuContextPaste. Peter George
2 212 In Step By Step 2.22, Step 7. Append the following sentence:
Change the MergeType property of mnuFile to MergeItems.
Royce Fickling
2 213 In Step By Step 2.22, Step 8, Append the following sentence:
Change the MergeOrder property of mnuWindow to 20.
Royce Fickling
2 213 In Step By Step 2.22, Step 10, insert the following sentence at the beginning:

From the toolbox, drag and drop a OpenFileDialog (dlgFileOpen) component onto the form.
Royce Fickling
2 213 In Step By Step 2.22, Step 10, change the following line in code:
//Set the current for as its parent

to:
//Set the current form as its parent 

Geoff Bishop
2 218 In Exercise 2.2, Step 3, change mnuExit to mnuFileExit Peter George
2 219 In Exercise 2.2, Step 5, remove the following line of code:
private System.Windows.Forms.MainMenu mnuMainMenu;
Peter George
3 241 In Step By Step 3.3, after Step 2 add the following using directive to the code:
using System.IO;
Ian Duncan
3 241 In Step By Step 3.3, Step 3, in the last comment "final" should be changed to "finally" Geoff Bishop
3 248 In Guided Practice Exercise 3.1, add the following using directive to the code:
using System.IO;
Ian Duncan
3 253 In Step By Step 3.5, Step 6, change the comment:
// Attach the UnhandledExceptionEventHandler to
// the UnhandledException of the AppDomain object

to the following:
// Attach the UnhandledExceptionEventHandler to
// the UnhandledException event of the AppDomain object

Geoff Bishop
3 268 In the first bullet of the Review Break, change "It a good practice..." to "It is a good practice..." Geoff Bishop
3 272 In Exercise 3.2, the last sentence of the first paragraph should read as: 
To achieve this, you can set the Cancel property of the CancelEventArgs argument of the field’s Validating event to true.
Montakan Thajchayapong
4 306 In Step By Step 4.5, Step 6, you need to double-click on the Changed event (rather than the Click event ) of the ColorMixerX control. Ian Duncan
4 306 In Step By Step 4.5, Step 7, change StepByStep4_4 to StepByStep4_5 and change StepByStep4_4.dll to StepByStep4_5.dll. Jacques Lacerte
4 321 In Guided Practice Exercise 4.2, Step 4, DigitalClock should be NumericTextBox Ian Duncan
4 342 In Exercise 4.1, Step 3, append the following sentence:
Set the Text property of all the three Label controls to 0.
Ian Duncan
4 343 In Exercise 4.2, Step 1, change Control Library to Application Jacques Lacerte
4 343 In Exercise 4.2, after step 3, add the following step:
Add a OpenFileDialog control (dlgOpen) to the form.

Replace the text of Step 5 with the following:
Double-click on the Button control and add the following code to its Click event handler:

Ian Duncan
4 348 Change the answer to the review question 2 with the following:

The event handler usually contains two parameters: the object that was the source of the event and an object of type System.EventArgs or its derived class that contains event-related data.

Jacques Lacerte
5 356 In Step By Step 5.1, Step 1, change 315C05 to 316C06 Jacques Lacerte
5 365 Change the Note on this page to the following:
The Northwind Sample Database Whenever I’ve used data from a database in this book, I’ve used the Northwind sample database that comes as part of SQL Server 2000. If you don't have SQL Server, you can use Microsoft Data Engine (MSDE) that installs as a part of the Microsoft .NET Framework SDK QuickStarts, Tutorials and Samples installation. Microsoft .NET SDK installs as a part of Visual Studio .NET or else can be installed from http://go.microsoft.com/fwlink/?LinkId=8684. If you use MSDE, you'll need to change the name of the database server in the book's code from (local) to (local)\NetSDK.
Royce Fickling
5 407 In Guided Practice Exercise 5.2, first paragraph, change ComboBox to ListBox. Jacques Lacerte
5 420 Change the last sentence of Question 7 to read as:

You want to ensure that data access code does not generate conflicts with the existing names of the tables or columns. Which of the following code segment should you use to load the data from the database into the DataSet object?

Jacques Lacerte
5 424 Answer to Question 7. Add the following text after the first sentence:

Answer C is incorrect because the following usage of the Fill() method: sqlDataAdapter1.Fill(dsPhysicians1);
will automatically create the table name, which may generate naming conflicts in your application.

Jacques Lacerte

 

6 450 Change the third UPDATE statement to:
UPDATE Products
SET Discontinued = 1
FROM Suppliers INNER JOIN Products
ON Suppliers.SupplierID = Products.SupplierID
WHERE Suppliers.country = 'Italy'
Jacques Lacerte
6 514 In Step By Step 6.24, Step 2, change btnAdd to btnUpdate. Peter George
6 530 Add the following line after the last line of code on this page:
xtr.Close();
Jacques Lacerte
6 543 In Step By Step 6.32, Step 2, change btnAdd to btnUpdate. Peter George
6 548-549 In Exercise 6.1, Step 8, the following two lines of code are not needed because the SqlDataAdapter object will automatically open and close the connection:
cnn.Open();
...
cnn.Close();
Jacques Lacerte
6. 550 In Exercise 6.2, Step 4, change the comment to:
// Load the product list
and the following two lines of code are not needed because the SqlDataAdapter object will automatically open and close the connection:
cnn.Open();
...
cnn.Close();

In Exercise 6.2, Step 5, change the for statement to:
for (int intI=0; intI < ds.Tables["Products"].Columns.Count; intI++)

Jacques Lacerte
6 551 In Exercise 6.3, append the following text at the end of Step 3:

Add the following declaration to the Exercise6_3 class:

SqlConnection cnn = new SqlConnection("Data Source=(local);" 
        + "Initial Catalog=Northwind;Integrated Security=SSPI"); 
DataSet ds = new DataSet();
SqlDataAdapter daCust = new SqlDataAdapter(); 
SqlDataAdapter daOrders = new SqlDataAdapter();

Peter George
7 580 In Guided Practice Exercise 7.1, Step 7, change ttxtCustomers to txtCountry. Peter George
8 606 In Step By Step 8.1, Step 3, change Culture to txtCulture. Peter George
8 627 In Step By Step 8.7, Step 4, change txtTest.Text to txtText.Text in the code. Peter George
8 636 Question 11, change option D to the following:
Retrieve a DateTime object from Thread.CurrentThread.CurrentUICulture and use its methods to format the dates.
Roux Beets
9 645 Step By Step 9.1, Step 6, change the sentence:
Select the COM tab in the Add Reference dialog Box.
to the following:
Select the .NET tab in the Add Reference dialog Box. 
Sebastien Lange
10 679 In the title bar, change "Study Strategeies" to "Study Strategies" Roux Beets
10 685 In Step By Step 10.2, Step 7 change the code to:
public Int32 Min
{
     get {
         return Int32.Parse(txtMin.Text);
     }
     set {
         txtMin.Text = value.ToString();
     }
}
public Int32 Max
{
     get {
          return Int32.Parse(txtMax.Text);
     }
    set {
         txtMax.Text = value.ToString();
     }
}
Jacques Lacerte
10 708 In the "Displaying the Help Button" Exam Tip, change MinButton to MinimizeBox, and change MaxButton to MaximizeBox. Rob Oyer
10 710 In the first and the fourth bullet point, change InitialDisplay to InitialDelay. Roman Makowski
10 722 In Exercise 10.2, Step 4, change the following line of code:
Beep();
to:
Beep(200, 250);
Jacques Lacerte
10 724 In Question 5, option C, change InitialDisplay to InitialDelay. Roman Makowski
11 739 In Step By Step 11.4, Step 5, change Color.Blue to Color.Yellow Peter George
11 762 In Step 7 of Exercise 11.1, replace the following piece of code:
// Build and print a string of data 
 String strPrint = " ";
 for(int intI = 0; intI < ds.Tables["Results"].Columns.Count; intI++) 

    DataColumn dc = ds.Tables["Results"].Columns[intI]; 
    strPrint = strPrint + dc.ColumnName + ": " + 
    dr[intI].ToString() + " "; 
    e.Graphics.DrawString(dr[intI].ToString(), fnt, Brushes.Black, intI*200, fltCurrentY ); 
}

with:
// Build and print a string of data 
 for(int intI = 0; intI < ds.Tables["Results"].Columns.Count; intI++) 
    e.Graphics.DrawString(dr[intI].ToString(), fnt, Brushes.Black, intI*200, fltCurrentY ); 

Randall Woodman
12 796-797 In Step By Step 12.3, replace steps 6 to 10 with the following (note that Step 9 and Step 10 have been eliminated):

6. Add a new Application configuration file (App.config) to the project. Each time you build the project, App.config will be copied to the project's output folder and renamed to AssemblyFileName.config (for example, StepByStep12_3.exe.config). Add the following configuration data to the App.config file:

<?xml version="1.0" encoding ="utf-8" ?>
<configuration>
      <system.diagnostics>
            <switches>
                     <add name="FactorialTrace" value="4" />
             </switches>
      </system.diagnostics>
</configuration>

7. Run the project, using the default Debug configuration. Enter the value 5; note that all messages appear in the output window. Enter a negative value and then a large value, and you see all the errors and warning messages. Close the form. Modify the configuration file to change the value of FactorialTrace to 3. Run the project again, you should now see all messages except the one set with TraceLevel as Verbose. Repeat the process, with values of FactorialTrace in the configuration file changed to 2, 1, and 0.

8. Modify the program to change all Debug statements to Trace statements and then repeat Step 7, using the Release configuration.

Peter George / Thom Little
12 799 In Step By Step 12.4, Step 5, change the name of the method from StepByStep12_4_Load to FactorialCalculator_Load. Peter George
12 820 In Exercise 12.1, append the following sentence at the end of Step 4:

Add the following using directive at the top of the program:
using System.Diagnostics; 

Peter George
12 821 In Exercise 12.5, Make changes to the following two steps:

8.  Add a new Application configuration file (App.config) to the project.

12. Modify the program to change all Debug statements to Trace statements and then repeat Step 11, using the Release configuration.

Peter George
13 855 In Step By Step 13.3, Step 7, change "... select Add, Create Folder." to "... select Add, Folder.". Peter George
13 865 In Step By Step 13.8, Step 4, change the first sentence to the following:
Select the newly created node under the Launch Conditions node and open the Properties window.
Roman Makowski
13 903 In Step By Step 13.20, Step 1, change Class Library to Windows Application. Peter George
14 958 Step By Step 14.3, Step 7, in the btnRemoveSource_Click() method, change the following statement:
string strSourceName = “StepByStep14_3” + cbEventLogs.Text;
to:
string strSourceName = “StepByStep14_3_” + cbEventLogs.Text;
Sebastien Lange
 
14 962 In Guided Practice Exercise 14.2, append the following sentence to Step 2:

Add the following using directive at the top of the program:
using System.Diagnostics; 

Peter George
14 968 In Step By Step 14.4, Step 3, change chChounterName to chCounterName. Peter George
14 980 In Exercise 14.2, Step 3, change chChounterName to chCounterName. Peter George
14 980 In Exercise 14.2, Step 4, change the second sentence to the following:

Set its Interval property to 1000.

Peter George
15 997 In Step By Step 15.1, Step 7, change the first sentence to:

Run the project's executable file again.
Practice Exam 1068 Question 27, Option D, change the first sentence to:
Create a DataView object that retrieves only the desired columns from the DataTable objects.
Jacques Lacerte
Practice Exam 1078 Question 78, Change the answers to the following:
A.
Arithmetic Exception
Unknown Exception

B.
Arithmetic Exception

C.
Result = Arithmetic Exception
Cleaning Up

D.
Arithmetic Exception
Cleaning Up

Dan Maltes

App. B

1098

The paragraph after the MCAD Elective Exams bullet list should read: You may also count as elective one of the four core exams 70-305, 70-306, 70-315, and 70-316. The elective exam must be from the opposite technology as the exam that you counted as core. For example, if you take the exam "Developing and Implementing Windows-based Applications With Visual C# .NET and Visual Studio .NET" (Exam 70-316) as a core exam, you can take either the "Developing and Implementing Web Applications With Visual C# .NET and Visual Studio .NET" (Exam 70-315) or the "Developing and Implementing Web Applications With Visual Basic .NET and Visual Studio .NET" (Exam 70-305) as an elective.

Karen Zhu

(end of errata)