private void btnLogin_Click(object sender, EventArgs e) { string user = vrUsername.Text; string pass = vrPassword.Text; con = new SqlConnection("server=DEVELOPER\\AYSE; Initial Catalog=afb; User ID = sa; Password = 123321 ; Integrated Security=SSPI"); cmd = new SqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "SELECT * FROM parLogin where username='******' AND password='******'"; dr = cmd.ExecuteReader(); if (dr.Read()) { scrMain frm = new scrMain(); //açılacak form frm.Show(); //form 2 açılıyor. this.Hide(); } else { MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz."); } con.Close(); }
private void scrGiderTanim_FormClosing(object sender, FormClosingEventArgs e) { scrMain frm = new scrMain(); frm.Show(); }