티스토리 뷰

string query = "select * from customer_tab";

MySqlCommand cmd;


cmd = new MySqlCommand(query, conn);


MySqlDataAdapter da = new MySqlDataAdapter(cmd);

DataTable table = new DataTable("myTable");

da.Fill(table);


foreach (DataRow row in table.Rows)

{

     for (int i = 0; i < row.ItemArray.Length; i++)

     {

          comboBox1.Items.Add(row.ItemArray[1].ToString());


     }

}






   MySqlConnection myConn = new MySqlConnection("datasource = '" + this.textBox_host_ip.Text + "';port=3306;username=root;password=password");

            string selectstring = "select * from wdata_mdb.factory where layout_name = '"+this.cb_layout.Text+"';";

            MySqlDataAdapter myadp = new MySqlDataAdapter(selectstring, myConn);

            DataTable table = new DataTable("robot");


            myadp.Fill(table);


            foreach (DataRow row in table.Rows)

            {

                this.cb_robot_id.Items.Add(row.ItemArray[4].ToString());

            }

댓글
최근에 달린 댓글
글 보관함
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글