0

Using c# with a windows form to read data from a data base.

     while (reader.Read())
                {
                    textbox1.Text += reader["Person"] + reader["Occur"].ToString() + "\n";                    
                }

Can somebody clear up why this displays like:

    John
     8

Instead of:

    John 8

EDIT: these are just an example of what's in my database table

user1353517
  • 300
  • 3
  • 10
  • 28

1 Answers1

1

I think that there is a carriage return stored with strings in the database. so you can easily get rid of it.

textbox1.Text += reader["Person"].ToString().Trim() + reader["Occur"].ToString();
Sleiman Jneidi
  • 22,907
  • 14
  • 56
  • 77