private void timer1_Tick(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TRAFİK1.xls;Extended Properties='Excel 8.0;HDR=YES;IMEX=1';"); con.Open(); OleDbCommand komut = new OleDbCommand("Select * from [Anasayfa$]", con); OleDbDataReader rd = komut.ExecuteReader(); bool durum = false; time++; progressBar1.Value = time; label6.Text = "%" + time + " Tamamlandı.Lütfen Bekleyin"; if (time == 100) { timer1.Stop(); time = 0; if (txtisim.Text != "" && txtsoyisim.Text != "" && txttcnumara.Text.ToString() != "" && txtdgmtarihi.Text != "") { while (rd.Read()) { if (rd["ADI"].ToString() == txtisim.Text) { if (rd["SOYADI"].ToString() == txtsoyisim.Text) { if (rd["TCNO"].ToString() == txttcnumara.Text) { if (Convert.ToInt32(rd["DOĞUMYILI"].ToString()) == Convert.ToInt32(txtdgmtarihi.Text.ToString())) { MessageBox.Show("ARANILAN KULLANICI MEVCUTTUR"); button1.Visible = true; button2.Visible = true; button3.Visible = true; button4.Visible = true; button5.Visible = true; button6.Visible = true; button7.Visible = true; button8.Visible = true; durum = true; AraçplakasınaYazılanTrafikcezaSorgulama frm = new AraçplakasınaYazılanTrafikcezaSorgulama(); break; } } } } } if (durum == false) { MessageBox.Show("ARANILAN KULLANICI MEVCUT DEĞİLDİR"); } } else { MessageBox.Show("KULLANICI BİLGİLERİ BOŞ GEÇİLEMEZ"); } //con.Close(); } con.Close(); }
private void Button1_Click(object sender, EventArgs e) { AraçplakasınaYazılanTrafikcezaSorgulama frm = new AraçplakasınaYazılanTrafikcezaSorgulama(); frm.txtisim.Text = txtisim.Text; frm.txtsoyisim.Text = txtsoyisim.Text; frm.txtdgmtarihi.Text = txtdgmtarihi.Text; frm.txttcnumara.Text = txttcnumara.Text; frm.ShowDialog(); }