![]() |
ExecuteNonQuery: Connection özelliği Başlatılmamış |
Post Reply ![]() |
|
Author | |
EEI ![]() Newbie ![]() Joined: 24 Mart 2021 Location: Ankara Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 24 Mart 2021 at 13:21 |
protected void kayitEkle()
{ string connkayit = "Provider=Microsoft.Ace.OleDb.12.0;Data Source=Database1.accdb"; OleDbConnection baglanti = new OleDbConnection(connkayit); OleDbCommand cmd = new OleDbCommand("insert into kayıt (KullanıcıAdı,Parola,TelefonNo,AdSoyad) values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')"); cmd.Parameters.AddWithValue("KullancıAdı", textBox1.Text); cmd.Parameters.AddWithValue("Parola", textBox2.Text); cmd.Parameters.AddWithValue("TelefonNo", textBox3.Text); cmd.Parameters.AddWithValue("AdSoyad", textBox4.Text); try { baglanti.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("Kayıt Başarılı"); } catch (Exception hata) { MessageBox.Show(hata.Message.ToString()); } finally { baglanti.Close(); } } private void button1_Click(object sender, EventArgs e) { kayitEkle(); Çalıştırdığım da kayıt butonu tıklaması sonrası ExecuteNonQuery : Connetictin özelliği Başlatılmamış hatası alıyorum. Nerede hata yapıyorum. Yardım edebilir misiniz?
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |