string  conn= "select * from T_DfEmployee where C_CheckDate between " + time1 + " and " + time2;

解决方案 »

  1.   

    有错误提示:第 1 行: '3' 附近有语法错误。 Line 42:  da.Fill(ds,"T_DfEmployee");
      

  2.   

    string  conn= "select * from T_DfEmployee where C_CheckDate between '" + time1 + "' and '" + time2+"'";
      

  3.   

    string  conn= "select * from T_DfEmployee where C_CheckDate between " + time1 + " and " + time2;
      

  4.   

    string  conn= "select * from T_DfEmployee where C_CheckDate between '" + time1.ToShortDateString() + "' and '" + time2.ToShortDateString()+"'";
      

  5.   

    select * from  T_DfEmployee 
    where
    cast( '20030101'  as datetime)
    between 
    getdate()  and DATEADD(day, 10, getdate())
      

  6.   

    to  webdiyer(陕北吴旗娃)
    time1.ToShortDateString() 是什么意思 
      

  7.   

    晕,连这也问??真是懒到家了,自己到.net框架帮助中搜!!
    切记:自己动手,丰衣足食!