Data type mismatch in criteria expression | Access, OleDb, C#

前端 未结 6 633
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 07:44

I read/update data from MS Access using C#. My code is:

public static void UpdateLastLogin(int userid, DateTime logintime) ///logintime = DateTime.Now
{
             


        
6条回答
  •  感动是毒
    2020-12-06 08:22

    maybe try

    DateTime.Now.ToShortDateString() + ' ' + DateTime.Now.ToShortTimeString()
    

    instead, pass it as String (and maybe enclose with # then)

提交回复
热议问题