Onaylı Üye
try
{
string user = gunaTextBox1.Text;
string pass = gunaTextBox2.Text;
con = new SqlConnection(@"Data Source=DESKTOP-AOM37KG\SQLEXPRESS;Initial Catalog=Loader;Integrated Security=True");
cmd = new SqlCommand();
con.Open();
cmd.Connection = con;
cmd.CommandText = "Select * From Login Where KAd = `" + gunaTextBox1.Text + "` and KSifre = `" + gunaTextBox2.Text + "`";
dr1 = cmd.ExecuteReader(); Burda Hata Veriyor. Diyer Benzer Kodlarıda Denedim Her Zaman Veriyi Çekerken Hata Veriyor
if (dr1.Read())
{
MessageBox.Show("Tebrikler! Başarılı bir şekilde giriş yaptınız.");
}
else
{
MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz.");
}
con.Close();
}
catch
{
MessageBox.Show("SQL Bağlantısı Hatalı", "Aporlorxl23", MessageBoxButtons.OK, MessageBoxIcon.Error);
con.Close();
}
{
string user = gunaTextBox1.Text;
string pass = gunaTextBox2.Text;
con = new SqlConnection(@"Data Source=DESKTOP-AOM37KG\SQLEXPRESS;Initial Catalog=Loader;Integrated Security=True");
cmd = new SqlCommand();
con.Open();
cmd.Connection = con;
cmd.CommandText = "Select * From Login Where KAd = `" + gunaTextBox1.Text + "` and KSifre = `" + gunaTextBox2.Text + "`";
dr1 = cmd.ExecuteReader(); Burda Hata Veriyor. Diyer Benzer Kodlarıda Denedim Her Zaman Veriyi Çekerken Hata Veriyor
if (dr1.Read())
{
MessageBox.Show("Tebrikler! Başarılı bir şekilde giriş yaptınız.");
}
else
{
MessageBox.Show("Kullanıcı adını ve şifrenizi kontrol ediniz.");
}
con.Close();
}
catch
{
MessageBox.Show("SQL Bağlantısı Hatalı", "Aporlorxl23", MessageBoxButtons.OK, MessageBoxIcon.Error);
con.Close();
}