Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.textBox11.Text = openFileDialog1.FileName;
            }
            string           yolBaglantisi = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + textBox11.Text + ";Extended Properties=\"Excel 8.0;HDR=Yes;\";";
            OleDbConnection  con           = new OleDbConnection(yolBaglantisi);
            OleDbDataAdapter myAdapter     = new OleDbDataAdapter("select * from [Sayfa1$]", con);
            DataTable        dt            = new DataTable();

            myAdapter.Fill(dt);
            dataGridView1.DataSource = dt;
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                MessageBox.Show(RandevuIslemleri.RandevuEkle(dataGridView1[0, i].Value.ToString(), dataGridView1[1, i].Value.ToString(), dataGridView1[2, i].Value.ToString(), Convert.ToInt32(dataGridView1[3, i].Value)));
            }
            //dataGridKayitGoster();
        }
Esempio n. 2
0
        private void button8_Click(object sender, EventArgs e)
        {
            string donustur = dateTimePicker1.Value.ToString("yyyy-MM-dd");

            if (textBox1.Text == "" && textBox2.Text == "" && comboBox1.Text == "" && dateTimePicker1.Text == "")
            {
                MessageBox.Show("Lütfen Gerekli Alanları Doldurun");
            }
            else
            {
                MessageBox.Show(RandevuIslemleri.RandevuEkle(comboBox1.Text, donustur, comboBox2.Text, Convert.ToInt32(textBox4.Text)));
                dataGridKayitGoster();
                textBox4.Text = "";
                textBox1.Text = "";
                textBox2.Text = "";

                comboBox1.Text       = "";
                dateTimePicker1.Text = "";
                comboBox1.Text       = "";
            }
        }