Beispiel #1
0
 private void showGrid()
 {
     try
     {
         string  sql = "select * from rak order by id_rak desc";
         DBClass db  = new DBClass();
         dgv.DataSource = db.read(sql); //set data gridview
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Beispiel #2
0
 private void showGrid()
 {
     try
     {
         String  sql = "select * from barang order by id_barang desc";
         DBClass db  = new DBClass(); //panggil class DB
         dgv.DataSource = db.read(sql);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Beispiel #3
0
 private void cariToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         String  sql = "select * from barang where barang like '%" + toolStripTextBox1.Text + "%' order by id_barang desc";
         DBClass db  = new DBClass(); //panggil class DB
         dgv.DataSource = db.read(sql);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Beispiel #4
0
 private void cariToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "select * from rak where rak " +
                      "like '%" + toolStripTextBox1.Text + "%' " +
                      "order by id_rak desc";
         DBClass db = new DBClass();
         dgv.DataSource = db.read(sql); //set data gridview
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
 private void loadBarang()
 {
     try
     {
         String    sql = "SELECT * FROM barang order BY id_barang desc";
         DBClass   db  = new DBClass();
         DataTable dt  = new DataTable();
         dt             = db.read(sql);
         dgv.DataSource = dt;
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        private void loadRak()
        {
            try
            {
                String  sql = "select * from rak order BY id_rak desc";
                DBClass db  = new DBClass();

                DataTable dt = new DataTable();
                dt = db.read(sql);

                cbxRak.DataSource    = new BindingSource(dt, null);
                cbxRak.DisplayMember = "rak";
                cbxRak.ValueMember   = "id_rak";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        void loadRak()
        {
            try
            {
                String  sql = "select * from rak order by id_rak asc";
                DBClass db  = new DBClass();

                DataTable dt = new DataTable();
                dt = db.read(sql);

                cb_filter_1.DataSource    = new BindingSource(dt, null);
                cb_filter_1.DisplayMember = "rak"; //kolom harus sesuai dengan tabel
                cb_filter_1.ValueMember   = "id_rak";

                cb_filter_2.DataSource    = new BindingSource(dt, null);
                cb_filter_2.DisplayMember = "rak"; //kolom harus sesuai dengan tabel
                cb_filter_2.ValueMember   = "id_rak";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }