Hallo Ulli,
das Problem liegt daran, das in der Datenbank DBNull steht. Das kannst Du
folgenderma�en abfangen:
If myDataReader(3) Is DBNull.Value Then
' ---- Hier wird die Variable mit einem leeren String gef�llt ----
myDataReader(3) = String.Empty
' ---- oder halt Dein Code um ein fest vorgegebenes Datum zu �bergeben ----
Datum(i) = myDataReader.getDateTime(3).Date
End If
Gru�
Hilmar
> Hallo,
>
> das funktioniert leider nicht.
> Hier nochmals mein angepasster Code:
>
> if not myDataReader(3) is nothing then
> Datum(i) = myDataReader.getDateTime(3).Date
> end if
>
> Es kommt die folgende Fehlermeldung:
>
>
> Data is Null. This method or property cannot be called on Null values.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.Data.SqlTypes.SqlNullValueException: Data is
> Null. This method or property cannot be called on Null values.
>
> Source Error:
>
>
> Line 74: Istzeit(i) = CInt(myDataReader.GetDouble(2)*10)
> Line 75: if not myDataReader(3) is nothing then
> Line 76: Datum(i) = myDataReader.getDateTime(3).Date
> Line 77: end if
> Line 78: i = i + 1
>
>
> Also funktioniert die Abfangmethode nicht.
> Gibt es sonst noch eine L�sung?
>
> Gru� Ulli
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
_______________________________________________
Vb.net Mailingliste, Postings senden an:
[email protected]
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/vb.net