-1
每次我嘗試運行,錯誤彈出窗口說語法錯誤插入語句的Visual C#和MS Access
語法錯誤插入插入
我試圖通過將改變語句[由於沒有保留關鍵字,因此大括號。
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
command.CommandText = "INSERT INTO lectrical([ItemName],Type,Quantity,Retail,Sale) value('"+ txtItemName.Text +` `"','" + txtType.Text + "','" + Convert.ToDecimal(txtQuantity.Text) + "','" +` `Convert.ToDecimal(txtRetail.Text) + "','" + Convert.ToDecimal(txtSale.Text) +` `"') ";
command.ExecuteNonQuery();