private void button1_Click(object sender, EventArgs e) { string kadi = textBox1.Text; string sifre = textBox2.Text; baglanti.Open(); dataset.Clear(); adaptor = new OleDbDataAdapter("select * from giris where kadi='" + kadi + "' and sifre='" + sifre + "'", baglanti); adaptor.Fill(dataset, "giris"); if (dataset.Tables["giris"].Rows.Count == 0) { MessageBox.Show("Kullanıcı Adı veya Şifre yanlış !"); adaptor.Dispose(); baglanti.Close(); } else { adaptor.Dispose(); baglanti.Close(); this.Hide(); anaform anaformm = new anaform(); anaformm.ShowDialog(); } }