protected void Button4_Click(object sender, EventArgs e)
{
OleDbConnection yeni = new OleDbConnection();
OleDbCommand eski = new OleDbCommand();
OleDbDataReader rdr;
yeni.ConnectionString = " Provider = Microsoft.Jet.OleDb.4.0; Data Source = " + Server.MapPath("kayit.mdb");
yeni.Open();
eski.Connection = yeni;
eski.CommandText = "SELECT * from kayit";
rdr = eski.ExecuteReader();
string KulAd, Sifre;
KulAd = TextBox6.Text;
Sifre = TextBox7.Text;
while (rdr.Read())
{
if (KulAd == Convert.ToString(rdr["KulAd"]) && Sifre == Convert.ToString (rdr["Sifre"]))
{
Response.Redirect("Anasayfa.aspx");
}
else
{
Response.Write("Hatalı Giriş");
}
yeni.Close();
}
}
}
}
Bu hazır kod'a ilk yorumu siz yapın!