using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using DBFactory; namespace ControlSystem { public partial class FrmConfigBar : Form { public FrmConfigBar() { InitializeComponent(); } static DBOperator dbo = CStaticClass.dbo; string[] strs = new string[5]; private void FrmConfigBar_Load(object sender, EventArgs e) { flash(); } public void flash() { this.comboBox1.Items.Clear(); string[] strs = new string[10]; DataView dv = dbo.ExceSQL("select * from T_Base_PLC_Ask n where n.F_DeviceIndex =14021").Tables[0].DefaultView; if (dv.Count > 0) { if (dv[0]["F_BarCode"] == DBNull.Value || dv[0]["F_BarCode"].ToString() == string.Empty) { return; } else { string F_BarCode = dv[0]["F_BarCode"].ToString(); strs = F_BarCode.Split('|'); } } for (int i = 0; i < 5; i++) { if (strs[i] != null && strs[i] != string.Empty) { this.comboBox1.Items.Add(strs[i]); } } this.lbCount.Text = this.comboBox1.Items.Count.ToString(); } private void button1_Click(object sender, EventArgs e) { } } }