Exemple #1
0
        private void cariBidang()
        {
            SubBidangBagian namaBidang = new SubBidangBagian();
            string          cari       = textBoxCariSubBidang.Text;

            Database        db      = new Database();
            string          strconn = db.getString();
            MySqlConnection conn    = new MySqlConnection(strconn);

            conn.Open();

            string query = "SELECT * FROM sub_bagian_bidang WHERE nama_sub_bagian_bidang LIKE '%" + cari + "%'";
            //MessageBox.Show(query);
            MySqlCommand cmd = new MySqlCommand(query, conn);

            cmd.Parameters.AddWithValue("@cari", cari);
            MySqlDataReader reader = cmd.ExecuteReader();

            setDataTable(reader);
            conn.Close();
        }
        private void cariBidang()
        {
            SubBidangBagian namaBidang = new SubBidangBagian();
            string cari = textBoxCariSubBidang.Text;

            Database db = new Database();
            string strconn = db.getString();
            MySqlConnection conn = new MySqlConnection(strconn);
            conn.Open();

            string query = "SELECT * FROM sub_bagian_bidang WHERE nama_sub_bagian_bidang LIKE '%" + cari + "%'";
            //MessageBox.Show(query);
            MySqlCommand cmd = new MySqlCommand(query, conn);
            cmd.Parameters.AddWithValue("@cari", cari);
            MySqlDataReader reader = cmd.ExecuteReader();

            setDataTable(reader);
            conn.Close();
        }