

[code lang="csharp"]
<span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;">
</span></pre>
protected void gonder_Click(object sender, EventArgs e)
{
OleDbConnection baglanti = new OleDbConnection();
baglanti.ConnectionString = ("Provider=microsoft.jet.oledb.4.0;Data Source=" + Server.MapPath("~/data/vt1.mdb"));
baglanti.Open();
OleDbCommand komut = new OleDbCommand("select kuladi,sifre from kisiler", baglanti);
OleDbDataReader oku = komut.ExecuteReader();
while (oku.Read())
{
if (TextBox1.Text == oku[0].ToString() && TextBox2.Text == oku[1].ToString())
{
Response.Redirect("default2.aspx"); // default2.aspx sayfasına yönlendirir
}
else
{
Label1.Text = "Yanlış Kullanıcı adı ve Şifre girdiniz..";
}
<span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;"> }</span>
<span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;">baglanti.Close();</span>
}
<pre><span style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; font-style: normal; line-height: 1.5;">
[/code]
Hiç yorum yok:
Yorum Gönder