Arkadaşlar veritabanı ile kullanıcı adı ve şifre yardımı ile giriş yapılıcak ama sorun yaşıyorum
--->
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Özel_Güvenlik_Öğrenci_Takip_Sistem
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private **** Form1_Load(object sender, EventArgs e)
{
}
private **** button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
OleDbConnection baglan = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=database.mdb");
private **** button1_Click(object sender, EventArgs e)
{
baglan.Open();
OleDbCommand komut = new OleDbCommand("SELECT * From admin WHERE id = '" + textBox1.Text + "' AND pass = '" + textBox2.Text + "'", baglan);
OleDbDataReader oku = komut.ExecuteReader();
if (oku.Read())
{
this.Visible = false;
{
Form form2 = new Form2();
form2.ShowDialog();
this.Hide();
form2.Show();
}
}
else if (textBox1.Text == "")
{
label3.Text = ("Kullanıcı Adını Boş Bırakamazsınız!");
}
else if (textBox1.Text == "")
{
label3.Text = ("Şifreyi Boş Bırakamazsınız!");
}
else
{
label3.Text = ("Kullanıcı Adı veya Şifre Yanlış");
}
}
}
}
şuan bişey farkettim -->
eksik diyo
baglan.Open() da hata alıyorum connect olmuyo nedeni ney sizce ?
--->
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Özel_Güvenlik_Öğrenci_Takip_Sistem
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private **** Form1_Load(object sender, EventArgs e)
{
}
private **** button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
OleDbConnection baglan = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=database.mdb");
private **** button1_Click(object sender, EventArgs e)
{
baglan.Open();
OleDbCommand komut = new OleDbCommand("SELECT * From admin WHERE id = '" + textBox1.Text + "' AND pass = '" + textBox2.Text + "'", baglan);
OleDbDataReader oku = komut.ExecuteReader();
if (oku.Read())
{
this.Visible = false;
{
Form form2 = new Form2();
form2.ShowDialog();
this.Hide();
form2.Show();
}
}
else if (textBox1.Text == "")
{
label3.Text = ("Kullanıcı Adını Boş Bırakamazsınız!");
}
else if (textBox1.Text == "")
{
label3.Text = ("Şifreyi Boş Bırakamazsınız!");
}
else
{
label3.Text = ("Kullanıcı Adı veya Şifre Yanlış");
}
}
}
}
şuan bişey farkettim -->
eksik diyo
baglan.Open() da hata alıyorum connect olmuyo nedeni ney sizce ?
Son düzenleme:

