I have a problem with this exercise - an error occurs on the following line:
Code:
goalsFor += Convert.ToInt32(rdr("GoalsFor"))
By experimentation I found that if I swapped this line and the following one (goalsAgainst += etc), the error occurred on this line instead. Also if I set a breakpoint on this line and then step through the code, the error occurs after a number of times through the While loop, so I conclude that it's a particular match in the Fixtures table that causes a problem, rather than something to do with the code itself.
Here is the error text:
Code:
System.InvalidCastException was unhandled by user code
Message="Object cannot be cast from DBNull to other types."
(rest of detail omitted)
I loaded the "End" version of Chapter09 in VWD, and Decisions.aspx ran in the browser without a problem, so I compared the two pages from the "Begin" & "End" folders.
The "End" version is using a PageInitComplete event instead of PageLoad. I can't spot any other differences. However, if I simply change the event in the "Begin" version, it still doesn't work.
If it helps, I will post the code but if you have the book, it's on p325.
Richard
Rugeley, UK
WinXP Pro SP2
VBW Express + SQL Server 2005 Express