This line iterates over all the lines in the first table of the dataset.
foreach (DataRow dr in ds.Tables[0].Rows)
This lines attempts to see if the value for the column named
EventDate is null
if ((dr["EventDate"].ToString() != DBNull.Value.ToString()))
but it's done incorrectly, it should be just this):
if ((dr["EventDate"] != DBNull.Value))
This lines get the
EventDate column out and casts it to a
DateTime
and stores that value in a local variable called
dtEvent
.
DateTime dtEvent = (DateTime)dr["EventDate"];
Hope this helps,
Fredrik