Beispiel #1
0
        private void button12_Click(object sender, EventArgs e)
        {
            Form21 s = new Form21();

            s.Show();
            this.Hide();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            conn.Open();
            string           query = "insert into sells (bill_no,name,date,product,price,quantity,total)values('" + textBox6.Text + "','" + textBox1.Text + "','" + dateTimePicker1.Value.ToString() + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "')";
            MySqlDataAdapter sda   = new MySqlDataAdapter(query, conn);
            DataTable        dt    = new DataTable();

            sda.Fill(dt);
            dataGridView1.DataSource = dt;
            Form21 s = new Form21();

            s.Show();
            this.Hide();
            conn.Close();
            count_a();
            printPreviewDialog1.Document = printDocument1;
            printPreviewDialog1.ShowDialog();
        }