First off, when you report a problem, put the actual question in the body, not teh subject - the subject gets truncated and we can't see what most of your problem is!
Secondly, do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
Thirdly, Your code won't even compile like that: there is no "text" property of a combobox as C# is case sensitive:
textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = "";textBox4.Text = ""; textBox5.Text = "";textBox6.Text = "";textBox7.Text = "";textBox8.Text = "";textBox9.Text = "";comboBox1.text="";comboBox3.text="";comboBox4.text="";
Fourthly, try making your code a little cleaner: Move all those clearing operations into a separate method:
private void ClearInputs()
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
textBox6.Text = "";
textBox7.Text = "";
textBox8.Text = "";
textBox9.Text = "";
comboBox1.Text = "";
comboBox3.Text = "";
comboBox4.Text = "";
}
And then call that wherever you need to clear the inputs.
Fifthly, stop using the VS default names for controls! You may remember today that
textBox8
holds the invoice detail, but when you look at this code in two weeks you won't, and it will make things a lot more awkward. Call it tbInvoiceDetail or something else which relates to it's function and your code becomes a lot clearer, easier to read, and more reliable (since you can tell more easily that you are using the right data)