Untitled

 avatar
unknown
csharp
5 years ago
2.2 kB
11
Indexable
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 EmlakTakip
{
    public partial class MusteriKayit : Form
    {

        public MusteriKayit()
        {
            InitializeComponent();
        }

        OleDbConnection vt_baglan = new OleDbConnection("provider=microsoft.Ace.OleDb.12.0;Data Source=VT_EmlakTakip.accdb");

        DataTable tablo;
        void MUSTERILERI_GOSTER()
        {
            vt_baglan.Open();
            OleDbDataAdapter sorgu = new OleDbDataAdapter("SELECT ID AS[ID], musteri_turu AS[MUSTERI TURU], Adi AS[ADI], Soyadi AS[SOYADI], gsm AS[GSM], ilce AS[İLÇE], sehir AS[SEHİR] FROM musteriler ORDER BY ID DESC", vt_baglan);
            DataTable tablo = new DataTable();
            sorgu.Fill(tablo);
            dgw_Musteriler.DataSource = tablo;
            vt_baglan.Close();
        }


        private void MusteriKayit_Load(object sender, EventArgs e)
        {
            MUSTERILERI_GOSTER();
        }
        //private void MUSTERILERI_GOSTER()
        //{
        //    try
        //    {
        //        vt_baglan.Open();
        //        OleDbDataAdapter sorgu = new OleDbDataAdapter("SELECT ID AS[ID], musteri_turu AS[MUSTERI TURU], Adi AS[ADI], Soyadi AS[SOYADI], gsm AS[GSM], ilce AS[İLÇE], sehir AS[SEHİR] FROM musteriler ORDER BY ID DESC", vt_baglan);
        //        DataTable tablo = new DataTable();
        //        sorgu.Fill(tablo);
        //        dgw_Musteriler.DataSource = tablo;
        //        vt_baglan.Close();


        //    }
        //    catch (Exception hataMsj)
        //    {

        //        MessageBox.Show(hataMsj.Message, "Emlak Takip Programi", MessageBoxButtons.OK, MessageBoxIcon.Error);
        //    }

        //}

        private void txt_Arama_TextChanged(object sender, EventArgs e)
        {
            DataView dv = tablo.DefaultView;
            dv.RowFilter = "Adi LIKE '" + txt_Arama.Text + "%'";
            dgw_Musteriler.DataSource = dv;

        }
    }
}
Editor is loading...