Error in Chapter 7

Wednesday, December 23 2009         No Comments

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.

Extra paren in example

Saturday, March 14 2009         No Comments

On Page 69 of the 2008 book, there is an extra paren in the second grey code blok on the page.  The text says:

NextWeek.Text = DateChooser.Value.AddDays(7)).ToString()

and it should say:

NextWeek.Text = DateChooser.Value.AddDays(7).ToString()

Good catch by Kurt - thanks.

S

Date formatting table on Page 173 is wrong

Friday, October 03 2008         No Comments

John T correctly points out that Word did a number on the table on Page 173.  Currently it looks like this:

D                         8/7/1971
D                         Saturday, August 7, 1971
G                        8/7/1971 12:00 AM
G                        8/7/1971 12:00:00 AM
S                        1971-08-07T00:00:00
Y                        August 1971

and that isn't right.  the first D should be a d and the first G should be a g.  The S should be a small s too.

All ofthe date formatting codes (which are great for use in ToString, too) are at this link:

http://msdn.microsoft.com/en-us/library/az4se3k1.aspx

S

 

There is no Inherits statement!

Saturday, May 31 2008         No Comments

On page 72 or therabouts, I state that you should put the Dim statement under the Inherits statement.  This is a cut-and-paste error, left over from when I used a web project for that chapter.  Windows Forms doesn't use the Inherits statement anymore in a default project. 

Just put the statement right after the Public Class statement.  Sorry about the confusion.  The good news is that was the only mistake that has been found (so far)!