public void refreshList() { List<string> namesList = new List<string>(); itemsList.DataSource = null; AODB aodb = new AODB(); foreach(int v in ex.ids) { string name = aodb.ExecuteScalar(String.Format("SELECT name FROM tblAO WHERE aoid={0};",v)); if(!String.IsNullOrEmpty(name)) { namesList.Add(String.Format("{0} - {1}",v,name)); } else { namesList.Add(v.ToString()); } } itemsList.DataSource = namesList.ToArray(); }
public void refreshList() { List <string> namesList = new List <string>(); itemsList.DataSource = null; AODB aodb = new AODB(); foreach (int v in ex.ids) { string name = aodb.ExecuteScalar(String.Format("SELECT name FROM tblAO WHERE aoid={0};", v)); if (!String.IsNullOrEmpty(name)) { namesList.Add(String.Format("{0} - {1}", v, name)); } else { namesList.Add(v.ToString()); } } itemsList.DataSource = namesList.ToArray(); }