Visual Basic.NET: Programming for Business/1e (Koneman) Clarifications and Errata (Chapters 1-7)

Chapter Page Error Clarification or Correction 1 10 In Figure 1.11the text in the right The text should read "... as well as images, ..." lower corner states "... as well ad images, ..." 1 29 The first line of the first code block Instruct students to press ALT- 0169 to enter is missing the copyright symbol. the symbol. 1 33 Figure 1.36 callout to imgLogo picLogo Callout to iblCopyright lblCopyright 1 34 Table 1.4 1. The "Text" property with the setting of Table alignment - the frmAbout "About[Application Name…]" is for the and picLogo rows have frmAbout object, not the picLogo object. interchanged elements. 2. The "Image" property is for the picLogo object, not the frmAbout object.

3. The txtDisplay text box should have a blank text property 1 41 Step 9 refers to "cmdLicenseInfo" Students should select "btnLicenseInfo" in the in the list. list. 1 41 Step 12 refers to "cmdOK" in the Students should select "btnOK" in the list. list. 1 47 Multiple Choice question 8, option The name should appear as btnExit. B, refers to cmdExit. 1 49 Step 1 does not explain where to To name the application as enter the name for the ASP.NET "Temperature_Conversion", highlight the application. application that follows the location, type "Temperature_Conversion", and click OK. 2 73 The second sentence in the The second argument for the InputBox paragraph below the second gray function defines the title that appears in the box states that the second title bar. It is more accurate to refer to this as InputBox argument defines the the title, not the label. text appearing in the label of the InputBox. 2 79- Table 2.7 80 txtPrincipal Set the Text property to 5000 lblPaymentResult Delete the default Text property lblFeeResult Delete the default Text property 2 84 Table 2.9 intTerm as Single Data type for intTerm is Integer 3 105 First code example The outer loop Else statements should line up in code with the initial If statement 3 109 intButtons = 524322 intButtons = 524324 3 110 Step 5. intButtons = 524322 intButtons = 524324 3 115 Flowchart in Figure 3.18 vbCrLf should not have spaces 3 123 Code example for Select…Case Code indentation is missing 3 128 Figure 3.26 Set the Text Property to Vehicle Type grpAutoType Group Box

Visual Basic.NET: Programming for Business (Updated 05/20/04) Page 1 Chapter Page Error Clarification or Correction 4 167- Table 4.1 168 txtPrincipal Align = MiddleCenter txtPrincipal Align = Center btnPayment

btnP&ayment Text Property btn&Payment

btnPayment and btnAbout Tab Tab Stop = True Stop = Yes

4 169 Figure 4.18 lblPrincipal and txtPrincipal labels are Location for lblPrincipal and swapped; the lblPrincipal control is leftmost. txtPrincipal controls 5 203 Paragraph for the StreamReader Reference should be strStream object refers to the myStream variable 5 217 Table 5.2 Reference should be rdbRTF Incorrect reference to the rdbButtonRTF object 6 262- The procedure beginning on page Omit the 6 lines of code on page 262, and the 263 contains code statements from the first 7 lines of code on page 263. previous procedure. The first line of code students type is the 6th line of code on page 263, which begins with Private Sub btnAdd_Click . Continue typing the procedure on pages 263 – 264, and make sure that students type End Sub as the last statement in the procedure, immediately after the End Try statement on page 294 (see footnote).1 7 290- Error in Code Example – duplicate Remove the comment and the CashBonus 291 function call call in the example at the top of page 291.

The End Sub statement should immediately follow the End If statement (see footnote).2 7 305 Figure 7.22 lbl Monthly Payment lblMonthlyPayment 7 306 Table 7.2 mnuFileCalculate mnuFileReturn

lblMonthlyDeposit and lblFVTitle Set TextAlign property to MiddleRight

txtMonthlyDeposit Set TabStop Property to True; set Text property value to an empty string, not 0. 7 311 Step 2 – Savings Analysis Add an apostrophe: Application is a comment 'Savings Analysis Application 7 314 Step 2 – Savings Analysis Add an apostrophe: Application is a comment 'Savings Analysis Application 7 317 Step 2 – Savings Analysis Add an apostrophe: Application is a comment 'Savings Analysis Application

Visual Basic.NET: Programming for Business (Updated 05/20/04) Page 2 Code Corrections

Visual Basic.NET: Programming for Business (Updated 05/20/04) Page 3 1 Code for the btnAdd_Click procedure, pages 262-264:

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click 'Declare a variable to add a row to the dataset Dim AddRow As DataRow

'Populate the new dataset row with date on the form AddRow = DataSet11.Tables("Employees").NewRow AddRow("EmpID") = txtEmpID.Text AddRow("FirstName") = txtFirstName.Text AddRow("LastName") = txtLastName.Text AddRow("Address") = txtAddress.Text AddRow("City") = txtCity.Text AddRow("State") = txtState.Text AddRow("ZipCode") = txtZipCode.Text AddRow("HomePhone") = txtHomePhone.Text AddRow("PayRate") = txtPayRate.Text

Try 'Add the new row to the dataset DataSet11.Tables("Employees").Rows.Add(AddRow)

'Update the database OleDbDataAdapter1.Update(DataSet11) MsgBox("A record has been added to the database.", MsgBoxStyle.Information, "Add Record")

'Refresh the DataSet OleDbDataAdapter1.Fill(DataSet11)

'Determine the number of records in the Dataset intTotalRecords = BindingContext(DataSet11, "Employees").Count lblTotalRecords.Text = intTotalRecords

'Navigate to the last record Me.BindingContext(DataSet11, "Employees").Position = intTotalRecords

'Set the current record variable intCurrentRecord = BindingContext(DataSet11, "Employees").Position + 1 lblCurrentRecord.Text = intCurrentRecord

'Disable the Last and Next buttons btnLast.Enabled = False btnNext.Enabled = False Catch MsgBox("Cannot save this record. The Employee ID must be unique.", MsgBoxStyle.Critical, "Save Operation Failed") Exit Try End Try End Sub

2 Code for the btnCalculate_Click event, example on pages 290-291 Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click 'Declare a variable for the sale amount Dim sngSaleAmount As Single

'Obtain the sale amount sngSaleAmount = Val(InputBox("Please enter the amount of the sale", "Enter Sale Amount"))

'Perform data validation If sngSaleAmount <= 500 Then MsgBox("The amount of the sales must be at least $500 to qualify for a bonus. Please try again.", MsgBoxStyle.Exclamation, "Invalid Sales Amount") Else MsgBox(Format(CashBonus(sngSaleAmount), "Currency"), MsgBoxStyle.Information, "Employee Bonus") End If End Sub