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 June 15th, 2007, 10:04 PM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can anyone give me some sample data?

The relations between the tables in the time tracker database is somewhat complicated to me, I can't figure out how to insert enough and correct records to let the application running without throw exception that is caused by can't finding relevant data.
Can anyone send me some working data? Great appreciation!

My email: kinzlaw@163.com
 
Old June 16th, 2007, 05:23 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Are you reading and following the book chapter-by-chapter? The reason that I ask is that the book was designed to take you through the application chapter by chapter with each chapter building on the previous chapter.

Chapter 1 has a diagram of the relationships between the tables in the database.

If you could be more specific as to what chapter you are having problems with I would be glad to try to assist you.

Thanks,
Thearon
 
Old June 16th, 2007, 06:03 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I read the book chapter-by-chapter, but mainly on copy-paste the try-it-out code to build the application. What I mean is some data but not the table structure. I got trouble in chapter 12 when the timesheets table got in use, to get the application working there should be many entries of data in the TimeSheetItems table which should be related to the other table. I think that the author would be better provide some sample data for that, so reader don't need to figure that out themselves.
Thanks.
 
Old June 16th, 2007, 06:14 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Hi,

I am the author and I'm trying to help. Could you give me the page and step number that you are having problems with?

Thearon
 
Old June 16th, 2007, 06:38 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem(may be I shouldn't say it's a problem) arises after I paste all code before page 414. After I log in using a user who is in the "Manager" role, I push the Employee comboBox and select an Item, then select a date in the Week Ending comboBox, the SQL Server gave me some error like:(there is some words in my locale, so I try to translate them to English)
System.InvalidCastException: there is no operator "+" for type “Integer” and type “DBNull” #12290;
   at Microsoft.VisualBasic.CompilerServices.Operators.A ddObject(Object Left, Object Right)
   at Time_Tracker.TimeSheet.LoadTimeSheet(ComboBox WeekEndingDate) location K:\VisualStudio\SQL\Time Tracker\TimeSheet.vb:line number 105

After debugging I figured out that the problem is there isn't the relevant data entries in table TimeSheetItems associate with the user and the date I selected. What I want you, the author, is to provide us some sample data that can be imported to the database and let the application work.

By the way, I've found that the code simply do the exception handling with a message box showing out the error message isn't very helpful to debug the code, while debugging I have to comment the try-catch block to left the exception unhandled so that I can see detailed explanation when exception is thrown.

 
Old June 16th, 2007, 06:48 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forgot to say, the code in the time tracker didn't pay good attention to DBNull arising when some data entry needed isn't available. I've found about three or more places where I have to add some code like below to let the code run.
if isDBNull(someEntryRetrievedFromDataBase) then
destinationVariable = String.Empty
else
destinationVariable = someEntryRetrievedFromDataBase

I don't know whether this would cause problem when dealing real world case where the data is in large quantity, but I guess there would be some users who don't have timeSheetItem associated. I'd like to hear from you what is the real world case, thank you very much!

 
Old June 18th, 2007, 04:42 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

The first step in testing the application at the point you indicated was to log on as a user first. This would have created the appropriate timesheet entries in the database. It is unclear if you have done this but if you try to do that first, then logging on as a manager should work fine.

While I'll admit that the application is far from perfect, it does serve the purpose of the book in showing you how to write database applications using Visual Basic 2005.

Part of the unit and system testing of your applications will be to find the weak parts of the design in your application and to add the appropriate error handling to display useful errors.

I hope this helps.

Thearon
 
Old June 19th, 2007, 05:04 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your patience, Thearon.
I do apologize for not reading the book carefully before posting here, I didn't notice that the TimeSheetItems table is filled automatically when Logging in correctly. I wish I haven't bothered you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
give me some sample exercises naveenmatt ASP.NET 2.0 Basics 1 January 2nd, 2008 06:22 PM
pls give the query for XML data in Sqlserver2005 veeruu SQL Server 2005 0 July 27th, 2006 05:07 AM
pls give query to diplay XML data in Sqlserver2005 veeruu XML 0 July 27th, 2006 05:06 AM
Can anyone give me a sample of Crossword Puzzle? sfs00784 General .NET 1 November 6th, 2004 01:37 PM
I can't find the sample code(C# Data Security..). snowstar Wrox Book Feedback 1 November 21st, 2003 12:39 PM





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