此代码在 MS-Access 中使用时正在运行并在属性中更新,但在通过数据库使用时会出现语法错误
string item = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
string h="update Follow_Date set Current_Date='" + dateTimePicker1.Value.ToLongDateString() + "', Current_Time='" + dateTimePicker3.Value.ToLongTimeString() + "', Type='" +
comboBox1.SelectedItem.ToString() + "', Remarks='" +
textBox1.Text + "', Next_Follow_Date='" + dateTimePicker2.Value.ToLongDateString()+ "' where Follow_Id='" +
item.ToString() +"'";
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\lernovo\Documents\JDB.mdb");
con.Open();
OleDbCommand cmd = new OleDbCommand(h, con);
cmd.ExecuteNonQuery();
错误是syntax error
。