public void userListLoader(ListView listview) { try { List <UserItems> items = new List <UserItems>(); object[,] li; li = db.DbSelectUsers(); int i = 0; while (li[i, 1] != null) { if (li[i, 0].ToString() != "admin") { string valid; string admin; if (li[i, 5].ToString() == "1") { valid = "igen"; } else { valid = "-"; } if (li[i, 3].ToString() == "1") { admin = "igen"; } else { admin = "-"; } items.Add(new UserItems() { col1 = li[i, 0].ToString(), col2 = li[i, 1].ToString(), col3 = li[i, 2].ToString(), col4 = admin, col5 = li[i, 4].ToString(), col6 = valid, col7 = li[i, 6].ToString() }); } i++; } listview.ItemsSource = items; } catch (Exception) { } }