1. sayfa
up uppp |
sanırım access veritabanını kullanıyosunuz dosya doğru yerdemi? |
evet dosya dogru yerınde projenın bın debug klasoru ıcınde. |
mobilim pc ye geçince bakarım |
sorun değişken isminde, dikkat 'baglantı' diye değişken ismi olmaz, özel karakter kullanma |
hertürlü denedım olmuyor. |
denedım hertürlü de hayla aynı |
ilk olarak bağlantı.open silip aynı satıra aşağıdaki kodu yaz. if (baglantı.State == ConnectionState.Closed) { baglantı.Open(); } sonra bağlantı.Close() ; yazdığın satırın altına okuyucu.Close(); yazıp dener misin. |
buda olmadı . |
OleDbCommand komut = new OleDbCommand("select*from vt where k_adı='" + textBox1.Text + "' and sifre='" + textBox2.Text + "',baglantı"); command nesnesine veitabnı connection vermemişsin bu satırla değiştir. ayrıda sql cümlende sifreden önce and olmalı onuda ekledim. :) |
yine düzelmedi ya bu nasıl bişey anlamadım. |
teamwiever verım ordan bakarmısın ? |
OleDbCommand komut = new OleDbCommand("select*from vt where k_adı='" + textBox1.Text + "'sifre='" + textBox2.Text + "'",baglanti); bu saturda connectşon özelliğini başlatmamşısın. |
PArdon kardeş OleDbCommand komut = new OleDbCommand("select * from vt where k_adı='" + textBox1.Text + "' and sifre='" + textBox2.Text + "'",baglantı); şekilinde olacak. |
1. sayfa
{
baglantı.Open();
OleDbCommand komut = new OleDbCommand("select*from vt where k_adı='" + textBox1.Text + "'sifre='" + textBox2.Text + "'");
OleDbDataReader okuyucu = komut.ExecuteReader();
while (okuyucu.Read())
{
if (textBox1.Text.ToString() == okuyucu["k_adı"].ToString())
{
if (textBox2.Text.ToString() == okuyucu["sifre"].ToString())
MessageBox.Show("Giris Basarılı");
frm2.Show();
kosemesajı f = new kosemesajı();
f.goster("Hoşgeldiniz" + "\n" + textBox1.Text);
f.Show();
}
else
{
MessageBox.Show("Kullanıcı adı veya Sifre Yanlıstır.");
}
baglantı.Close();
}
}
kodlarını yazdıgımda ExecuteReader: Connection özelliği başlatılmamış. bu hatayı alıyorum sebebı ne olabılır ?