C# 求助! SQLServer数据库中的 字段的Datetime值 赋值 给dateTimePicker 如何实现?

2024-12-01 17:03:32
推荐回答(2个)
回答1:

object obj = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[4].Value;
DateTime time = Convert.ToDateTime(obj);
dateTimePicker.Value = time;

回答2:

dateTimePicker.Value=Datetime值