DateTime Dt = DateTime.Now;
string str=Dt.toString();
sql = "select * from mytable where birthday>'" + Dt+"'";

解决方案 »

  1.   

    刚才写错了应该改为:
    sql = "select * from mytable where birthday>'" + str+"'";
      

  2.   

    试试 sql = "select * from mytable where birthday>convert(datetime,120,'" + Dt+"')"; 
      

  3.   

    sorry,应该是试试 sql = "select * from mytable where birthday>convert(datetime,'" + Dt+"',120)"; 
      

  4.   

    同意楼上的,用convert函数转换就可以了,SQL Server的帮助上convert函数的用法很多的。
      

  5.   

    sql="select * from mytable where birthday>'" & now & "'"