harish main

harish main

  • NA
  • 10
  • 0

not able to display SQL data in newline into multiline textbox using C#

Mar 14 2011 3:02 PM
I have following code in c# for retrieving data and displaying the content into multiline textbox. The content is getting displayed but iam unable to show it in new line on different timestamps. I want 1:10 on first line, followed by 1:11 on next line and so on.

LOG_DETAILS column has value like:
'1:10 Database connection to log db was successfully made by user1. 1:11 address error - the address column  contains invalid special character therefore webservice call wont be made. 1:12 user1 attempted to change the address and did not save changes'

Iam using .Net 1.1 Framework

SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
  //Assign to your textbox here 
  TextBoxLogInfo.Text = sdr["LOG_DETAILS"].ToString(); 
}

Please help to display such content in new lines in multiline text box.

Your help appreciated

Harish

Answers (9)