Answer the question
In order to leave comments, you need to log in
How to serialize / deserialize data to / from Json from a ListBox that is filled with List?
The bottom line is this. Hours and minutes are taken from two textboxes, respectively. The whole thing is brought into the sheet and converted to the TimeSpan format. But here at a stage of serialization the error takes off. I know that the error is in the conversion method. Please tell me what is wrong with me.
First I put it on the sheet
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Add(txtHours.Text+":"+txtMinutes.Text);
}
foreach (string f in listBox1.Items)
{
returnCompany.TimeSchedule.Add(TimeSpan.Parse(f));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question