我试图从 datetimepicker 中选择日期和时间并从数据库中获取值,但它不起作用。任何人都可以帮助我。
这是我的命令:
OleDbCommand com1 = new OleDbCommand("select * from tblConsumption where date between #"dateTimePicker1.Value.ToShortDateString"# and #"dateTimePicker2.Value.ToShortDateString"#",con);