我在DataTable(dt)中有一个日期。如何读取一个数据表中的日期为文本框如何从数据表读取日期到文本框中
我可以在精细读的字符串:
tbEvent.Text = dt.Rows[0].Field<String>(0);
我试过,但我得到一个错误:
Unable to cast object of type 'System.DateTime' to type 'System.String'.
tbDate.Text = dt.Rows[0].Field<DateTime>(1);
问候 茶
曾为感谢。如何修剪显示日期而不是日期和时间的数据?我可以在同一个陈述中做到吗? – TeaDrinkingGeek
查看已更新的答案 – Kami