I load the database in listbox by this code:
using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString))
{
myDatabaseConnection.Open();
using (SqlCommand SqlCommand = new SqlCommand("Select ID, LastName from Employee", myDatabaseConnection))
{
SqlDataReader dr = SqlCommand.ExecuteReader();
while (dr.Read())
{
listBox1.Items.Add((string)dr["LastName"] + " " + dr["ID"]);
}
}
}
Result:
How to align the data like this in listbox?