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.