获取当前时间,并插入数据库出现问题!
......//连接数据库省略
string sql = "Insert into news (title,author,content,date) values ( ' "+title.Text.Trim()+ " ', ' "+author.Text.Trim()+ " ', ' "+content.Text.Trim()+ " ', ' "+DateTime.Now+ " ') ";
OleDbCommand Comm = new OleDbCommand(sql,Conn);
Comm.ExecuteNonQuery();
Conn.Close();
出现这样的提示 “INSERT INTO 语句的语法错误。”
------解决方案--------------------date要加个[date]呀?
------解决方案--------------------同意楼上的