void kontrol() { if (baglanti.State == ConnectionState.Closed) { baglanti.Open(); } SqlCommand komut = new SqlCommand("select *from kullanicilar where kullanici_adi='" + textBox1.Text + "' and sifre='" + textBox2.Text + "'", baglanti); SqlDataReader oku = komut.ExecuteReader(); if (oku.Read()) { Anasayfa fr1 = new Anasayfa(); fr1.Show(); this.Hide(); } else { MessageBox.Show("kullanıcı adı veya şifre hatalı !!! "); baglanti.Close(); } }