Best way to represent a color in a SQL Database?

前端 未结 6 1172
情歌与酒
情歌与酒 2021-01-12 04:14

If I am using .Net and SQL Server 2008, what is the best way for me to store a color in the database, should I use ToString or convert it to an integer, or something else?

6条回答
  •  [愿得一人]
    2021-01-12 04:33

    How are the colors stored natively?

    If you're just using 0xRRGGBB format, you may as well store it as an integer in the database, and re-hexify it when you SELECT (for readability).

提交回复
热议问题