if (k==2) dds = initSys.ws.GetMaterielPDMList(tj1); // if (k==3) dds = initSys.ws.GetMaterielPZVList(tj2); if (k==4) dds = initSys.ws.GetMaterielPDMList("type <> '1'"); // if (k==5) dds = initSys.ws.GetMaterielPZVList(tj3);
if (dds != null) { dt = dds.Tables[0]; ni = dt.Rows.Count;
if (k==2) this.comboBox2.Items.Clear(); // if (k==3) this.comboBox3.Items.Clear(); if (k==4) this.comboBox4.Items.Clear(); // if (k==5) this.comboBox5.Items.Clear();
if ( ni>0) { for(int i = 0; i< ni; i++ ) { line = dt.Rows[i].ItemArray[0].ToString().Trim(); if (k==2) this.comboBox2.Items.Add(line); // if (k==3) this.comboBox3.Items.Add(line); if (k==4) this.comboBox4.Items.Add(line); // if (k==5) this.comboBox5.Items.Add(line); } if (k==2 && this.comboBox2.Items.Count == 1) this.comboBox2.SelectedIndex=0; // if (k==3 && this.comboBox3.Items.Count == 1) this.comboBox3.SelectedIndex=0; if (k==4 && this.comboBox4.Items.Count == 1) this.comboBox4.SelectedIndex=0; // if (k==5 && this.comboBox5.Items.Count == 1) this.comboBox5.SelectedIndex=0; } } else initSys.TS_MessageBox("数据库访问错误!"); } 看不懂这段程序