System.FormatException: 'String was not recognized as a valid

23 Views Asked by At

Dim day As String = Label22.Text Dim week As String = DateTime.ParseExact(day, "dd/MM/yyyy", CultureInfo.InvariantCulture).DayOfWeek.ToString Label88.Text = week

more things but nothing

1

There are 1 best solutions below

0
VillageTech On

You forgot parenthesis after ToString method call :) Each method call must contain the parameter list in parenthesis - even if the parameter list is empty.

Should be:

Dim day As String = Label22.Text 
Dim week As String = DateTime.ParseExact(day, "dd/MM/yyyy", CultureInfo.InvariantCulture).DayOfWeek.ToString() 
Rem --------------------------------------------------------------------------------------------------------^^ here!

Label88.Text = week