111,126
社区成员
发帖
与我相关
我的任务
分享object date = 你从数据库中取得的值;
textbox1.Text = date.GetType() == typeof(DateTime) ? ((DateTime)date).ToString("yyyy-MM-dd") : "";object date = dr["datetimecol"]; // 你从数据库中取得的值
textbox1.Text = date is DBNull ? "" : ((DateTime)date).ToString("yyyy-MM-dd");