hey I'm trying to run this query:
command.UseSqlCommand("INSERT INTO DisplayOrders Values ('" + OrderId.Text + "','" + "(SELECT ProductId FROM Products WHERE ProductName =N'" + listBox1.Text + "')','" + listBox1.Text + "','" + OrderQuantity.Text + "','" + TotalCost.Text + "')");
now the command.UseSqlCommand
is just running the query, but I keep getting this error:
incorrect syntax near 'intel'
(intel is the 'ProductName' (that I'm getting from here:
SELECT ProductId FROM Products WHERE ProductName =N'" + listBox1.Text + "'
Edit : this is the value of the command , (getting the 'incorrect syntax near 'intel')
INSERT INTO DisplayOrders
Values ('2', '(SELECT ProductId FROM Products WHERE ProductName =N'Intel Quad Core i5 3470 3.2Ghz 6MB Tray')','Intel Quad Core i5 3470 3.2Ghz 6MB Tray','1','900')"