Unable to cast object of type 'System.DateTime' to type 'System.String'

Immer ein Fehler, dass hat mich etwas verblüfft. Ich nehme an, es ist etwas einfach, aber kann nicht scheinen, um diese Figur ein, das ist der code, der den Fehler verursacht:

if ((string) _nullableDateTimePicker1.Value != string.Empty && _nullableDateTimePicker1.Value != null) {
     _nullableDateTimePicker1.Value = null;
}

Beim Klick auf den suchen-button in meine windows form, das ist es, was ich aufspringen:

Unable to cast object of type 'System.DateTime' to type 'System.String'.

InformationsquelleAutor C-Sharp-Noob | 2013-04-25
Schreibe einen Kommentar