Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > BOOK: Beginning VB.NET Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 29th, 2005, 11:23 PM
Authorized User
 
Join Date: Feb 2005
Location: , SC, USA.
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
Reply With Quote
  #2 (permalink)  
Old November 30th, 2005, 07:23 AM
Authorized User
 
Join Date: Feb 2005
Location: , SC, USA.
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



Reply With Quote
  #3 (permalink)  
Old November 30th, 2005, 09:35 AM
Authorized User
 
Join Date: Feb 2005
Location: , SC, USA.
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



Reply With Quote
  #4 (permalink)  
Old January 22nd, 2006, 09:44 AM
Authorized User
 
Join Date: Feb 2005
Location: , SC, USA.
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



Reply With Quote
  #5 (permalink)  
Old January 23rd, 2006, 07:29 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
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
Reply With Quote
  #6 (permalink)  
Old February 11th, 2006, 08:15 PM
Registered User
 
Join Date: Feb 2006
Location: Minneapolis, MN, USA.
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!

Reply With Quote
  #7 (permalink)  
Old February 14th, 2006, 08:06 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
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
Reply With Quote
  #8 (permalink)  
Old November 2nd, 2006, 09:14 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
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?

Reply With Quote
  #9 (permalink)  
Old November 6th, 2006, 07:07 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
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
Reply With Quote
  #10 (permalink)  
Old April 22nd, 2010, 02: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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03:47 PM
Ch. 4 & Ch. 12 athena BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 23rd, 2004 11:54 AM



All times are GMT -4. The time now is 11:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.