con.Open();
SqlCommand cmd = new SqlCommand(@"INSERT INTO donorinfo (donorid,name,fathersname,age,sex,cnicno,mobileno,dateofbirth,city,address,eyecolor,bloodgroup,dateofdonation) VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + comboBox1.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','" + dateofbirth.Text + "','" + textBox9.Text + "','" + textBox10.Text + "','" + comboBox2.Text + "','" + comboBox3.Text + "','" + dateofdonation.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Succesfully saved", "info");
clear();
Display();
I am working on blood bank management system here is my insert button code.