Error in Chapter 7

Wednesday, December 23 2009

Simon found a pretty good sized error on page 135, where I consume the datecalc web service.  The code reads:

Public Class DateCalc
     Private Sub StartDatePicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartDatePicker.ValueChanged
        Dim myDateCalc As Chapter7.DateCalcSoap
        Label1.Text = myDateCalc.IncreaseDate(StartDatePicker.Value, 13
    End Sub
End Class

and it clearly should read something like Simon's solution:

Public Class DateCalc
    Private Sub StartDatePicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartDatePicker.ValueChanged
        Dim myDateCalc As New Chapter7.DateCalcSoapClient
        Label1.Text = myDateCalc.IncreaseDate(StartDatePicker.Value, 7).ToString
    End Sub
End Class

I incorrectly referenced the interface, and just had an old fashioned cut-and-paste error in the IncreaseDate line.