Ich bekomme "INSERT INTO Syntax Fehler" Int meine Abfrage, ich habe keine Ahnung warum. (Die Verbindung zu Access ist in einer anderen Klasse).INSERT INTO Syntax Fehler C#, Zugriff
public void InsertOrder(Order Item) // add new order
{
string cmdStr = "INSERT INTO [Order] (CostumerID,ProID,ProName,ProPrice,Comments,Discount,Color,Size,Quantity,OrdertDate) VALUES (@costumerID,@proID,@proName,@proPrice,@comments,@discount,@proColor,@proSize,@quantity,@orderDate)";
using (OleDbCommand command = new OleDbCommand(cmdStr))
{
command.Parameters.AddWithValue("@costumerID", Item.CostumerID);
command.Parameters.AddWithValue("@proID", Item.ProId);
command.Parameters.AddWithValue("@proName", Item.ProName);
command.Parameters.AddWithValue("@proPrice", Item.ProPrice);
command.Parameters.AddWithValue("@comments", Item.Comments);
command.Parameters.AddWithValue("@discount", Item.Discount);
command.Parameters.AddWithValue("@proColor", Item.ProColor);
command.Parameters.AddWithValue("@proSize", Item.ProSize);
command.Parameters.AddWithValue("@quantity", Item.Quantity);
command.Parameters.AddWithValue("@orderDate", Item.OrderDate);
base.ExecuteSimpleQuery(command);
}
}
Irgendwelche Hilfe bitte? Danke!
Sie haben 8 Fragen gestellt und 11 Antworten erhalten, aber keine von ihnen akzeptiert. Wie in der [Tour] erklärt, akzeptieren Antworten und (später) Upvoting hilft anderen Nutzern, gute Antworten zu finden. Bitte nimm dir einen Moment Zeit, um die [Tour] zu machen und klicke auf das Häkchen bei einigen der letzten Antworten, die du bekommen hast. – Plutonix