You can use the
IsDBNull
function to check if the column contain any non-null value. Here is an example on how to do that. By the way what the For loop doing?
Dim FDT As String
Dim fdtIndex As Integer
For I = 0 To LEN - 1
If LvMasterReader.Read() Then
fdtIndex = LvMasterReader.GetOrdinal("From_Date")
If Not LvMasterReader.IsDBNull(fdtIndex) Then
FDT = LvMasterReader(fdtIndex).ToString
FDT = CDate(FDT)
FDT = FormatDateTime(FDT, vbShortDate)
Else
FDT = String.Empty
End If
End If
Next
SqlDataReader.GetOrdinal Method (String) (System.Data.SqlClient)[
^]