I have a table which i want to store all the outputs into one row seperated by a space(eg "textbox1 textbox2 textbox3". How would i do this? At the moment its trying to put them into different columns. Giving me an error stating im using fewer columns.
}
using (SqlCommand cmd = new SqlCommand("INSERT INTO [user] (solution) VALUES (@textbox1, @textbox2, @textbox3)", cn))
{
cmd.Parameters.AddWithValue("@textbox1", textBox1.Text);
cmd.Parameters.AddWithValue("@textbox2", textBox2.Text);
cmd.Parameters.AddWithValue("@textbox3", textBox3.Text);
cmd.ExecuteNonQuery(); // or int affected = cmd.ExecuteNonQuery()
MessageBox.Show("Success!");
}
}