str="update table set  time='"+DateTime.Now+"'where id=22"  不行str="update table set  time= "+DateTime.Now.ToString()+" where id=22"  不行该怎么办?
才能更新数据库(access)表内的时间字段?格式就是2003-9-25 6:26:10 这样的

解决方案 »

  1.   


    update table set  time=#2003-9-25 6:26:10# where id=22
      

  2.   

    str="update table set  time='#"+DateTime.Now+"#'where id=22"
      

  3.   

    update table set  time=#2003-9-25 6:26:10# where id=22
      

  4.   

    str="update table set time=#" + DateTime.Now + "# where id=22"
      

  5.   

    在事务提交前我输出sql语句
    发现是
    update topic set lastuser_id='A' last_time=#2003-9-25 16:16:54# where topic_id=82
    但是事务不提交
      

  6.   

    update topic set lastuser_id='A' ,(逗号)last_time=#2003-9-25 16:16:54# where topic_id=82