public int Selectstring production int condition DateTimePicker StartTime DateTimePicker EndTime string sql = $select count from ProductProductionRe
存在语法错误。应该将DateTimePicker的值转换为字符串,并在SQL语句中使用单引号将其括起来,如下所示:
string sql = $@"select count(*) from {ProductProductionRecorderTableMainName}{production} where {ProductionData} >= '{StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss")}' and {ProductionData} <= '{EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss")}' and {ProductionCondition} = {condition} ";
原文地址: https://www.cveoy.top/t/topic/7Du 著作权归作者所有。请勿转载和采集!