/// <summary> /// Updates the form view with the current list of servers in the database /// </summary> private void ListServers() { var ds = NetworkClasses.GetServers(); foreach (DataRow row in ds.Tables[0].Rows) { var grabber = NetworkClasses.GetPlayer(int.Parse(row["Host"].ToString())); var listItem = new ListViewItem(grabber.Tables[0].Rows[0]["Username"].ToString()); listItem.SubItems.Add(grabber.Tables[0].Rows[0]["Local_IP"].ToString()); listItem.SubItems.Add(NetworkClasses.GetNumPlayers(int.Parse(row["Server_ID"].ToString())) + "/6"); listItem.SubItems.Add(row["Status"].ToString()); //Add the row entry to the listview serverList.Items.Add(listItem); } }