D
dm1608
I'm doing an ASP.NET 2.0 project where I have a BAL and DAL layer. I'm
passing a DataSet from the DAL to the BAL. The BAL is passing generics back
to the presentation. All works fine, however, I noticed a problem with my
code that does something like this in the BAL:
List<JobSummary> jobSummary = new List<JobSummary>();
foreach (DataRow row in ds.Tables[0].Rows)
{
jobSummary.Add(new JobSummaryClass((Int32)row["JobNum"],
(DateTime)row["StartDate"],(DateTime)row["EndDate"]));
}
return jobSummary
I'm receiving an INvalidCastException on my jobSummary.Add() above. I
noticed that on some rows, my EndTime is null. I'm temporarily fixed this
by enclosing the code in a try/catch and not rethrowing the exception. But
then this record is skipped.
What are my options with how to fix this?
passing a DataSet from the DAL to the BAL. The BAL is passing generics back
to the presentation. All works fine, however, I noticed a problem with my
code that does something like this in the BAL:
List<JobSummary> jobSummary = new List<JobSummary>();
foreach (DataRow row in ds.Tables[0].Rows)
{
jobSummary.Add(new JobSummaryClass((Int32)row["JobNum"],
(DateTime)row["StartDate"],(DateTime)row["EndDate"]));
}
return jobSummary
I'm receiving an INvalidCastException on my jobSummary.Add() above. I
noticed that on some rows, my EndTime is null. I'm temporarily fixed this
by enclosing the code in a try/catch and not rethrowing the exception. But
then this record is skipped.
What are my options with how to fix this?