I couldn't figure this out: I want to add a row in a table-a and 3 columns of this row will come from table-b and other 2 columns will come from e.g textboxes... This code didn't work...
SqlCommand cmd35 = new SqlCommand("INSERT INTO BTmr (Barcode,[Machine Name],[Machine ID]) SELECT Barcode,[Machine Name],[Machine ID] FROM BkmP WHERE barcode like '" + c13 + "%' UNION INSERT INTO BTmr([Repair Cost],[Repair Date],Barcode)values (@cst,@rprd)", connection);
cmd35.Parameters.AddWithValue("@cst", textBox10.Text);
cmd35.Parameters.AddWithValue("@rprd", dateTimePicker1.Text);