Replacing a DateTime.MinValue in a DataGridView

后端 未结 8 1777
悲哀的现实
悲哀的现实 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条回答
  •  猫巷女王i
    2021-01-17 23:23

    While it may be quite straightforward to achieve the transformation you need (see the excellent answers preceding mine), I feel that you should ideally replace all the DateTime.MinValue values in this particular column in the database with NULL. This would correctly represent the actual lack of data in this position. At present your database contains incorrect data and you are trying to post-process the data for display.

    Consequently, you would be able to handle the display of data in your GridView using the EmptyDataText or NullDisplayText properties to provide appropriate rendering.

提交回复
热议问题