c# - String not recognized a timespan -
hope me this. yesterday code working, after did cleaning stop working , keeps on saying: string not recognized valid timespan datatable dt = new datatable(); dt = database.getschedule(); timespan amtime; timespan pmtime; timespan nntime; timespan _timenow = timespan.parse(timenow); foreach (datarow row in dt.rows) { amtime = timespan.parse(row["amintake"].tostring()); pmtime = timespan.parse(row["pmintake"].tostring()); nntime = timespan.parse(row["nnintake"].tostring()); if (amtime == _timenow || pmtime == _timenow || nntime == _timenow) { messagebox.show("drink medicine"); } else { /*do nothing*/ }