Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 1; i < sheet.RowsCount; i++)
- {
- var cells = sheet.GetRow(i).Cells;
- (...)
- // cells are strings
- if (!DateTime.TryParse(cells[1], out DateTime date))
- {
- Console.WriteLine($"Unable to parse DateTime for row {i}"); // <--- here
- continue;
- }
- }
- for (int i = 1; i < sheet.RowsCount; i++)
- {
- var cells = sheet.GetRow(i).Cells;
- (...)
- // cells are strings
- if (!DateTime.TryParse(cells[1]), out DateTime date))
- {
- throw new Exception($"Problem with parsing DateTime at {i} row"); // <--- here
- }
- }
Add Comment
Please, Sign In to add comment