コード例 #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            AddCombo DicData = new AddCombo();

            string[] DictionaryData = DicData.DirectroyData();
            string[] testdata       = { "a", "b" };


            this.button1   = new System.Windows.Forms.Button();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label1    = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(503, 158);
            this.button1.Name     = "button1";
            this.button1.Size     = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text     = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // comboBox1
            //
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(DictionaryData);
            this.comboBox1.Location = new System.Drawing.Point(163, 160);
            this.comboBox1.Name     = "comboBox1";
            this.comboBox1.Size     = new System.Drawing.Size(121, 21);
            this.comboBox1.TabIndex = 1;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(223, 104);
            this.label1.Name     = "label1";
            this.label1.Size     = new System.Drawing.Size(35, 13);
            this.label1.TabIndex = 2;
            this.label1.Text     = "label1";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.comboBox1);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);
            this.PerformLayout();
        }
コード例 #2
0
        public void InitializeData()
        {
            AddCombo.Clear();
            RemoveCombo.Clear();
            var reader = SqlUtils.ExecuteQueryReader("select * from college", false);

            while (reader.Read())
            {
                AddCombo.AddItem(reader["college_info"].ToString());
                RemoveCombo.AddItem(reader["college_info"].ToString());
            }
        }