字符串如何赋值DateTimePicker
我数据库中日期是20121214这样的模式,我想吧这个日期赋值给DateTimePicker
应该如何转换?
[解决办法]
dateTimePicker1.Value = DateTime.ParseExact("20121214", "yyyyMMdd", null);
Dim youTime As Date
Date.TryParseExact("20121214", "yyyyMMdd", Nothing, Globalization.DateTimeStyles.None, youTime)
DateTimePicker1.Value = youTime