yakupnun Posted December 25, 2015 Share Posted December 25, 2015 (edited) Çözdüm insert into kullanırken bir tana , fazladan koymuşum başlık nasıl sılınır bil miyorum adminler silebilirler gereksiz yer işgal etmesin. merhabalar acces veri tabanına birşeyler eklameya calışıyorum öğrenme amaçlı. kodum bu using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.OleDb; namespace acces_veri_tabanı { public partial class Form1 : Form { public Form1() { InitializeComponent(); } OleDbConnection baglantı = new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Kişiler.mdb"); private void VerileriGörüntüle() { listView1.Items.Clear(); baglantı.Open(); OleDbCommand komut = new OleDbCommand (); komut.Connection = baglantı; komut.CommandText = ("SELECT * from Bilgiler"); OleDbDataReader oku = komut.ExecuteReader(); while (oku.Read()) { ListViewItem ekle = new ListViewItem(); ekle.Text = oku["Ad"].ToString(); ekle.SubItems.Add(oku["Soyad"].ToString()); ekle.SubItems.Add(oku["Yaş"].ToString()); ekle.SubItems.Add(oku["İlçe"].ToString()); listView1.Items.Add(ekle); } baglantı.Close(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { VerileriGörüntüle(); } private void button2_Click(object sender, EventArgs e) { baglantı.Open(); OleDbCommand komut = new OleDbCommand("inset into Bilgiler (Ad,Soyad,Yaş,İlçe) values ('" + textBox1.Text.ToString() + "','" + textBox2.Text.ToString() + "','" + textBox3.Text.ToString() + "','" + textBox4.Text.ToString() + "',)", baglantı); komut.ExecuteNonQuery(); baglantı.Close(); VerileriGörüntüle(); } } } yalnız listeleme yapabiliyorum ama kaydet tuşunu tıkladığımda program şu hatayı veriyor yardımcı olabilirseniz sevinirim. Edited December 25, 2015 by yakupnun Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.