日期更新问题,高手们帮帮忙?
rhs 2004-04-28 01:02:30 结果是:“标准表达式中数据类型不匹配”。但是voteData字段类型是短日期型,按理由就没错啊。究竟是哪错了??
try
{
this.conn.Open();
System.Data.OleDb.OleDbDataAdapter DA = new OleDbDataAdapter("select * from tblmember",this.conn);
System.Data.OleDb.OleDbCommand Com = new OleDbCommand();
Com.Connection = this.conn;
Com.CommandText = "update tblmember set voteDate ="+ @System.DateTime.Today.ToShortDateString() +" where ID = " + this.userID;
DA.UpdateCommand = Com;
Com.ExecuteNonQuery();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
this.conn.Close();
}