If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then

Non credo che serva però, se non cambi il codice