private void SqlInsert_Click(object sender, EventArgs e)
{
1.  int st;
2.  double av;
3.  int un;
4.  SqlCommand cmdClasf;
5.  string strSql1;
6.  string strSql2;
7.  st = Convert.ToInt16(textBox2.Text);
8.  av = Convert.ToDouble(textBox4.Text);
10. un = Convert.ToInt16(textBox5.Text);
11. strSql1 = "INSERT INTO stTable(" + "stNo, " +
     "Name, " +
     "Ave, " +
     "numUnit, " +
     "Sex " +
     ") VALUES ('" + st + "', '" +
     textBox3.Text + "','" +
     av + "', '" + un +
    "', 1 )";
12. strSql2 = "INSERT INTO stTable(" + "stNo, " +
     "Name, " +
     "Ave, " +
     "numUnit, " +
     "Sex " +
      ") VALUES ('" + st + "', '" +
        textBox3.Text + "','" +
        av + "', '" + un +
      "', 0 )";
13. con.Open();
14. if (checkBox1.Checked)
15.    cmdClasf = new SqlCommand(strSql1, con);
16. else
17.   cmdClasf = new SqlCommand(strSql2, con);
18. cmdClasf.ExecuteNonQuery();
19. con.Close();
20. MessageBox.Show("Insert Completed .");
21. ds.Clear();
22. da.Fill(ds, "stTable");
23. con.Close();
}
