VB.NET: Eingabezeichenfolge hatte nicht korrekten format

Mit dem folgenden snippet

Foo = IIf(String.IsNullOrEmpty(txtFoo.Text), 0, Integer.Parse(txtFoo.Text.Trim))

Bekomme ich die Fehlermeldung, wenn ich behaupte, dass das Feld ohne Wert: "die Eingabezeichenfolge hat das falsche format."
Ich habe keine Leerzeichen oder etwas anderes und String.IsNullOrEmpty(txtFoo.Text) gibt true zurück. Was ist falsch?
Danke.

InformationsquelleAutor thomas | 2010-12-01
Schreibe einen Kommentar