SQL:
select *
from tvideoconference
where del = 'false'
and iduserpatient = 0 and startdate >= N'18.02.2013 20:37:07'
order by startdate
错误:
将 nvarchar 数据类型转换为 datetime 数据类型导致值超出范围。
当我尝试在de-DE
会话文化中使用以下方法时,出现此错误。更重要的是,在pl-PL
文化en-US
方面,这种方法非常有效。
public static DataSet getSpecialistConfs(int iduserspecialist)
{
DateTime? today = DateTime.Now;
today = today.Value.AddHours(-today.Value.Hour).AddMinutes(-(today.Value.Minute + 1));
string sql = "select * from tvideoconference where del='false' and startdate >=N'" + today.Value + "' and iduserspecialist=" + iduserspecialist;
sql += " order by startdate ";
return Tools.SQLTools.getDataSet(sql);
}
我该如何解决?我尝试了许多解决方案(子字符串,日期格式),效果相同..