System.Data.OleDb.OleDbException: 'Gerekli bir veya daha fazla parametre için girilen değer yok.' Hatası alıyorum oku komutundan. Nerede yanlış yapmış olabilirim?https://eksiup.com/p/6810183wxzgq protected void btnGiris_Click(object sender, EventArgs e) { string kad, ksifre
System.Data.OleDb.OleDbException: 'Gerekli bir veya daha fazla parametre için girilen değer yok.'
Hatası alıyorum oku komutundan. Nerede yanlış yapmış olabilirim?
eksiup.com protected void btnGiris_Click(object sender, EventArgs e)
{
string kad, ksifre;
kad = txtAd.Text;
ksifre = txtSifre.Text;
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Server.MapPath("App_Data\\admin.mdb"));
OleDbCommand komut = new OleDbCommand();
string sorgu = "Select* from admin where StrComp(KullaniciAdi,@ad,0)=0 and StrComp(Şifre,@sifre, 0) = 0";
komut = new OleDbCommand(sorgu, baglanti);
komut.Parameters.AddWithValue("@ad", kad);
komut.Parameters.AddWithValue("@sifre", ksifre);
baglanti.Open();
OleDbDataReader oku = komut.ExecuteReader();
if (oku.Read())
{
Session.Add("Kullanici", kad);
Response.Redirect("girisd.aspx");
}
else
{
lblDurum.Text = "Giriş Başarısız";
}
baglanti.Close();