using LINQ to print all data from a table in SQL server and print to a listbox
using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { string name = reader["Name"].ToString(); string lastName = reader["LastName"].ToString(); Debug.WriteLine($"Name: {name} Lastname: {lastName}"); } }