Hello:
I have a listbox with DateTime objects.
I then have a method that I need to call and pass in the items from the listbox:
public bool copyFiles(List<string> datesProcess)
I attempt to call the method passing in the listbox:
if (obj.copyFiles(lstProcessDate.Items.Cast<string>().ToList()))
{ ...
I then receive the error:
Unable to cast object of type 'System.DateTime' to type 'System.String'.
How can I cast the DateTime items from the listbox to pass them in correctly as a list of string objects?
Thanks Before Hand