草庐IT

OrdersPerHour

全部标签

c# - 无法将类型 'int?' 隐式转换为 'int' 。

我收到错误消息“无法隐式转换类型‘int?’到'int'。在返回行的我的OrdersPerHour上存在显式转换(你是否缺少强制转换?)”。我不确定为什么,因为我的C#技能不是那么先进。任何帮助将不胜感激。staticintOrdersPerHour(stringUser){int?OrdersPerHour;OleDbConnectionconn=newOleDbConnection(strAccessConn);DateTimecurTime=DateTime.Now;try{stringquery="SELECTCOUNT(ControlNumber)FROMLogWHEREDa

c# - 无法将类型 'int?' 隐式转换为 'int' 。

我收到错误消息“无法隐式转换类型‘int?’到'int'。在返回行的我的OrdersPerHour上存在显式转换(你是否缺少强制转换?)”。我不确定为什么,因为我的C#技能不是那么先进。任何帮助将不胜感激。staticintOrdersPerHour(stringUser){int?OrdersPerHour;OleDbConnectionconn=newOleDbConnection(strAccessConn);DateTimecurTime=DateTime.Now;try{stringquery="SELECTCOUNT(ControlNumber)FROMLogWHEREDa