Hi ya guys,
Cant seem to figure this one out, would not mind some help from the experts
Its giving me an error of "Cast from type DBNull to type String is not valid." on the following line.
I am using a third party of software incase some of the code look strange.
Thanks inadvance
Simon
Cant seem to figure this one out, would not mind some help from the experts
Code:
Do While myReader.Read
If (myReader.Item("Disp")) <> "Admin" Then
Dim dateCol = New DateTimeColumn(myReader.Item("Disp"))
dateCol.EditorStyle = EditorStyle.DropDown
dateCol.FormatString = "dd/MM/yyyy"
Me.lstDates.Columns.Items.AddRange(New Column() {dateCol})
For j = 0 To dsDates.Tables("dates").Rows.Count - 1
If Trim(dsDates.Tables("dates").Rows(j).Item((myReader.Item("Disp")) & "To")) Is DBNull.Value Then
strDateTo = Nothing
Else
strDateTo = Trim(dsDates.Tables("dates").Rows(j).Item((myReader.Item("Disp")) & "To"))
End If
If Trim(dsDates.Tables("dates").Rows(j).Item((myReader.Item("Disp")) & "From")) Is DBNull.Value Then
strDateFrom = Nothing
Else
strDateFrom = Trim(dsDates.Tables("dates").Rows(j).Item((myReader.Item("Disp")) & "From"))
End If
Next
End If
Loop
Its giving me an error of "Cast from type DBNull to type String is not valid." on the following line.
Code:
If Trim(dsDates.Tables("dates").Rows(j).Item((myReader.Item("Disp")) & "To")) Is DBNull.Value Then
I am using a third party of software incase some of the code look strange.
Thanks inadvance
Simon