Insert Into TableName DateTime Values ?
我用ACCESS新建了一个表(TableName),其中有一个DateTime字段(日期/时间型)。
VB2008中,我想让表单上的DateTimePicker的日期时间存入表中。
我的代码:
objCommand.CommandText="Insert Into TableName DateTime Values @DateTime"
objCommand.Parameters.AddWithValue("@DateTime",DateTimePicker.value)
但运行时,提示:Insert Into 语法错误?
小弟初学,不知错在何处,请大虾们不吝赐教!
PS:DateTime字段、DateTimePicker 的format 均设置为yyyy-MM-dd hh:mm