Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2010, 12:54 AM
Registered User
 
Join Date: Apr 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default LoadTimeSheet

Dear Sir/Madam:

I am Pisith Oum, a beginner to programming. I completely finished all Try It Out from Chapter 1 to 11. Everything worked perfectly (no error) when I run the application that I have built by following the instructions from the book. However, when I completed the Try It Out (Implementing Login and Timesheet Functionality, Page 394) in Chapter 12 and test the application again I encounter the error(s) during debugging mode as "Operator '+' is not defined for type 'Integer' and type 'DBNull'." in the following line of bold code text below:

Private Sub LoadTimeSheet(ByVal WeekEndingDate As ComboBox)
'Clear previous bindings
grdTimeSheet.DataSource = Nothing
grdTimeSheet.DataMember = String.Empty
grdTimeSheet.Columns.Clear()

'Initialize a new instance of the business logic component
Using objTimeSheets As New WroxBusinessLogic.WBLTimeSheets( _
strCompany, strApplication)

'Get the timesheet for the user
objTimeSheetDS = objTimeSheets.GetTimeSheet( _
New Guid(strUserID), WeekEndingDate.SelectedItem)

'Set the DataView object with the data from the DataSet
objTimeSheetDV = New Data.DataView(objTimeSheetDS.Tables("TimeSheet"))

'Initialize a new DataRowView object
Dim objDataRowView As Data.DataRowView = objTimeSheetDV.AddNew

'Set the values in the columns
objDataRowView("ProjectName") = "Total Hours"

'Calculate and set the total hours for Monday
intTotal = 0
For intIndex = 0 To objTimeSheetDS.Tables("TimeSheet").Rows.Count - 1
intTotal += objTimeSheetDS.Tables( _
"TimeSheet").Rows(intIndex).Item("MondayHours" )
Next
..........................

End Sub


I am trying to fixed the problem many days, but cannot.

Would you please help me to solve this issue.
 
Old April 22nd, 2010, 11:46 PM
Registered User
 
Join Date: Apr 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default LoadTimeSheet

Dear All,

This issue is once posted in this forum. I Already verify the solution provided but still has error.

You have any idea?

Thanks,

Pisith Oum





Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 12 LoadTimeSheet() Problem chuck BOOK: Beginning VB.NET Databases 11 July 26th, 2012 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.