Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How do i get text to move to a new line? Ithought it was \ . However that doesn\

ID: 3770497 • Letter: H

Question

How do i get text to move to a new line? Ithought it was . However that doesn't seem to work.

I have two pieces of code that write to the same textbox

the first is after an update statement and it writes to the text with the following

txtSample.Text = ("Total records... " + count + " ");

the other is

foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
                            txtSample.Text += " " +row[i].ToString() + " ";
                        txtSample.Text += " ";
                    }
                    conn.Close();

when i run the code the text box will show:

Total records... (somenumber) record1

record2

record3 etc...

instead of:

Total records... (somenumber)

record1

record2

record3 etc..

How can I get this to display properly?

Explanation / Answer

Plese check this

txtSample.Text = ("Total records... " + count + " ");
the other is
foreach (DataRow row in ds.Tables[0].Rows)
{
for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
txtSample.Text += " " +row[i].ToString() + " ";
txtSample.Text += " ";
}
conn.Close();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote