Exemplo n.º 1
0
 void ReloadData()
 {
     LBGroups.Reset("select GroupID,GroupName from LabelGroups where LocationID=" + INI.GetLocationID() + " order by GroupOrder", "GroupName", "GroupID");
     try { FirstGroupID = ((DataRowView)LBGroups.Items[0])["GroupID"].ToString(); }
     catch { FirstGroupID = "0"; }
     LBLabels.Reset("select LabelName,Path from Labels where GroupID=" + FirstGroupID + " order by LabelOrder", "LabelName", "Path");
     try { LBGroups.SelectedIndex = 0; }
     catch { }
     LBLabels.Focus();
 }
Exemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)//重载ListBox
 {
     //LB.Reload();//一般重载
     LB.Reset("select ContactName,CompanyName from Customers", "CompanyName", "ContactName");//更换SQL重载
 }