Wrox Programmer Forums
|
BOOK: Beginning VB.NET Databases
This is the forum to discuss the Wrox book Beginning VB.NET Databases by Thearon Willis; ISBN: 9780764568008
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET Databases 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 November 29th, 2005, 11:23 PM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH 12 LoadTimeSheet() Problem

I am having a problem in CH 12 - trying to log in as a user returns the following error:

Code:
Operator is not valid for type "Integer" and type "DBNULL"
The error is returned at this line of code from TimeSheet.vb:

Code:
intTotal += objTimeSheetDS.Tables( _
                "TimeSheet").Rows(intIndex).Item("MondayHours")

I believe it is looking for rows of data that do not exist in the DB.

I am using the code downloaded from Wrox.com.

Any help with this would be appreciated - This problem is identical to the 2nd problem posted in this forum (hgcheong), but that solution will not help in this case as I have not typed the code for the solution and can assume that the code is correct.

Chuck
 
Old November 30th, 2005, 07:23 AM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Additional - just completely installed everything needed for the Time Tracker project on my home computer (other post was in regards to work computer) and I get the same error. Am able to add users using the Command Window method on Pages 348-349. When I attempt to logon as User1, I get the same error at home that I did at work. As before, I am using the code from the book, so it is not a typo error.

Operator is not valid for type "Integer" and type "DBNULL"

Anyone have any ideas?

Chuck



 
Old November 30th, 2005, 09:35 AM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If anyone has the time, could you shoot me a quick screen shot of valid data for the TimeSheets and TimeSheetItems tables, then I can be on my way, and I will return the favor if I can someday.

Chuck



 
Old January 22nd, 2006, 09:44 AM
Authorized User
 
Join Date: Feb 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I still need the answer to this problem, I put it on the back burner until I get the code to continue.

Chuck



 
Old January 23rd, 2006, 07:29 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Chuck,

You should never run across an instance where the employee does not have a timesheet. Check the GetTimeSheet procedure in the WDATimeSheets class in the data access component. This procedure checks the DataSet after you call the usp_SelectTimeSheet stored procedure and if it is empty, it calls the AddTimeSheet procedure to insert an empty timesheet.

Thearon
 
Old February 11th, 2006, 08:15 PM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thearon,
I'm having this same problem in Chap. 12(Private Sub LoadTimeSheet). The problem is that when it queries the new time sheet record (usp_SelectTimeSheets)after it gets added to the TimeSheets table, it looks for an integer value for "MondayHours" in the objTimeSheetsDS RecordSet, but finds a NULL value. That's where the error occurs.
Was there a spot I'm missing that converts these NULLS to zeros?
Please help!
Thanks.
John

* The book has been great so far!

 
Old February 14th, 2006, 08:06 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

You'll need to set a breakpoint on the line of code:

        objTimeSheetDS = objTimeSheets.GetTimeSheet( _
            New Guid(strUserID), WeekEndingDate.SelectedItem)

in the LoadTimeSheet procedure and trace this call through line by line to determine where the problem lies.

When you get to the GetTimeSheet procedure in the WDATimeSheets class, ensure the UserID and WeekEndingDate parameters contain values.

Thearon
 
Old November 2nd, 2006, 09:14 AM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just downloaded code from site and is experiencing the same problem. Did not see a resolution to this problem in previous responses. Thus, how do I resolve this issue?

 
Old November 6th, 2006, 07:07 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

When you installed SQL Server, did you perform a default installation of SQL Server or did you customize the installation options?

Thearon
 
Old April 22nd, 2010, 01:41 AM
Registered User
 
Join Date: Apr 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default LoadTimeSheet

Dear chuck,

How this issue solve?

Best Regards,

Thanks

Pisith Oum





Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 12 login nightmare gegala BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 December 31st, 2007 09:34 AM
ch 12 php logins ejurasin BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 March 13th, 2006 02:24 PM
Ch. 12 Connect.asp mcauliff BOOK: Beginning ASP 3.0 2 August 5th, 2005 02:47 PM
Ch. 4 & Ch. 12 athena BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 23rd, 2004 10:54 AM





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