Beating my head against the wall on the error Object reference not set to an instance of an object.
See code below. The offending line is marked with <!—>>>>>>>
string htmlOutput = " ";
htmlOutput += "<h3>employee: " + employee.lastName + ", " + employee.firstName + " (" + thisForm.employeeID + ")</h3>" +
"<h3>Submitted To: " + thisForm.boss + "</h3>" +
if (job1.JRN != "" || job1.JRN != "INVALID")
{
<!--->>>>>>>htmlOutput += "<hr /><h4>Job 1</h4> " + "<h3>" + database.getjobName(job1.JRN) + " (" + job1.JRN + ")</h3>";
htmlOutput += "<h3>Date of Last Attendance: " + job1.month + " " + job1.day + ", " + job1.year + "</h3>";
htmlOutput += "<h3>Pass/Fail: " + job1.passFail + "</h3>";
}
Use
String.Format("{0}{1}", obj1, obj2 ?? ""). And use debugger, put breakpoint to this line and inspect objects, then add validation logic. Maybe the problem is indatabase.getjobNamemethod code. You can always use the null coalescing operator. Never use string concatenation like in your example, it’s very ugly and error prone.