Replacing a DateTime.MinValue in a DataGridView

后端 未结 8 1711
悲哀的现实
悲哀的现实 2021-01-17 22:42

I am working on a name record application and the information is stored in a SQLite database. All columns in the database are TEXT types, except for the date of birth column

8条回答
  •  [愿得一人]
    2021-01-17 23:28

    Use nullabe DateTime format instead of DateTime ("DateTime?") - don't use string.

    example:

    public DateTime? mydate;
    

    and then:

    DGview.Rows.Add(mydate.HasValue ? mydate : null);
    

提交回复
热议问题