• 12-05-2014, 23:46:03
    #1
    Merhaba Arkadaşlar Yazdığım Programda 1-2 Saat Öncesinde Herşey Normaldi Bilgisyaarı Kapattım Actım Ve Her Fonksiyonda bu Hatayı Veriyor Diyeceksiniz Veritabanıyla Kontrol Et Sorun o 5 i Gecik Kontrol etim Ama Sonuç Yok
    Hata:
    Sorgu değerleri ile hedef alanların sayısı aynı değil.
    Kodlar:
    OleDbConnection baglan = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=Ürünler.mdb");
                DialogResult sonuc;
                sonuc = MessageBox.Show("Bu Veriyi Kaydetmek İstiyormusunuz ?", "Uyarı", MessageBoxButtons.OKCancel);
                if (sonuc == DialogResult.OK)
                {
                    baglan.Open();
                    OleDbCommand kmt = new OleDbCommand("Insert into pckayit(İsim,Adres,Telefon,Cihazadı,Serino,Tamirnotu,Ücret) VALUES  ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')", baglan);
                    kmt.ExecuteReader();
                    // OleDbCommand kayıtSorgusu = new OleDbCommand();
                    //kayıtSorgusu.CommandText = "INSERT Into pckayit ([])Values ("')";
                    // kayıtSorgusu.Connection = baglan;
                    // kayıtSorgusu.ExecuteNonQuery();
                    baglan.Close();
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox4.Clear();
                    textBox5.Clear();
                    textBox6.Clear();
                    textBox8.Clear();
                    DatagridYenileee();
                    MessageBox.Show("Veriler Kaydedildi");
                }
    Bu Sorun eklemede Değil Güncellemedede Var Silme Düzgün Çalışıyor ama bu Böyle
  • 12-05-2014, 23:58:19
    #2
    Üyeliği durduruldu
    OleDbCommand kmt = new OleDbCommand("Insert into pckayit(İsim,Adres,Telefon,Cihazadı,Serino,Tamirnotu,Ücret) VALUES  ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')", baglan);
                    kmt.ExecuteReader();
    7 vs 6 değil mi
  • 13-05-2014, 01:15:03
    #3
    Abicim Tam 6 Saatir Bu Koda Bakıyorum ve onu Göremedim Yuh Artık bana Ya Cidden Bi Saçma Oldum Bu Hatayı görünce Teşşekürler Abicim

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 01:15:03 -->-> Daha önceki mesaj 00:13:04 --

    Şimdide Güncele Butonunda

    Ölçüt ifadesinde veri türü uyuşmazlığı.
    Hatası Veriyor Kodlar:
    DataSet ds = new DataSet();
                        ds.Clear();
                        baglan.Open();
                        OleDbCommand komut = new OleDbCommand("UPDATE pckayit SET İsim='" + textBox1.Text + "',Adres='" + textBox2.Text + "',Telefon='" + textBox3.Text + "',Cihazadı='" + textBox4.Text + "',serino='" + textBox5.Text + "', Tamirnotu='" + textBox6.Text + "', Ücret='" + textBox8.Text + "', Durum='" + comboBox1.SelectedItem + "'where ID='" + textBox9.Text + "'", baglan);
                        komut.ExecuteNonQuery();
                        textBox5.Clear();
                        textBox4.Clear();
                        textBox3.Clear();
                        textBox2.Clear();
                        textBox1.Clear();
                        textBox6.Clear();
                        textBox8.Clear();
                        baglan.Close();
                        MessageBox.Show("Veriler Güncellendi");
    
                        DataSet dss = new DataSet();
                        dss.Clear();
                        baglan.Open();
                        OleDbDataAdapter Adapter = new OleDbDataAdapter("Select * From pckayit", baglan);
                        Adapter.Fill(dss, "pckayit");
                        dataGridView1.DataSource = dss;
                        dataGridView1.DataMember = "pckayit";
                        baglan.Close();
                        dss.Dispose();
                        Adapter.Dispose();