using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace komutla_data
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        OleDbConnection bag = new OleDbConnection("provider=Microsoft.Jet.Oledb.4.0 ;Data Source=data.mdb");
        OleDbCommand komut = new OleDbCommand();
       
        private void Form1_Load(object sender, EventArgs e)
        {
            oleDbDataAdapter1.Fill(dataSet11, "kisib");
             
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            komut.Connection = bag;
            bag.Open();
            komut.CommandText = "insert into kisib(Tc_Kimlik,Ad,Soyad,Alan) values('"+textBox1.Text+"','"+textBox2.Text+"','"+textBox3.Text+"','"+textBox4.Text+"') ";
            komut.ExecuteNonQuery();
            bag.Close();
            oleDbDataAdapter1.Update(dataSet11);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            komut.Connection = bag;
            bag.Open();
            komut.CommandText = "delete from kisib where Tc_Kimlik='" + textBox1.Text + "'";
            komut.ExecuteNonQuery();
            bag.Close();
       
        }

        private void button4_Click(object sender, EventArgs e)
        {
            komut.Connection = bag;
            bag.Open();
            komut.CommandText = "update  kisib  set Ad='" + textBox2.Text + "',Soyad='" + textBox3.Text + "',Alan='" + textBox4.Text + "' where Tc_Kimlik='" +textBox1.Text + "'";
            komut.ExecuteNonQuery();
            bag.Close();
        }
    }
}
