Retrieve a String with original formatting from SQL Table and Show in C# Windows form

  • Thread starter Thread starter AMJEE
  • Start date Start date
A

AMJEE

Guest
multiple line's (and tabs/spaces etc.) string stored in a Database table column. Example,

I've executed the following SQL and I know SQL correctly preserves the formatting here (Tab/Newline etc.) and we have verified that formatting SSMS with Results in 'textview' (We use use default Result to Gridview then it will still appear as one single line statement on, but 'textview' or 'fileview' shows that formatting was retained by SQL).

But I've no clue how I can display it in this similar format in C# form/textbox when I'll read it from database. Seems over here in the textbox it is automatically converting everything as one line and all escape characters are ignored. Any help please how can I retain the formatting?

Insert Into myTable(longtext)
Select
'*****************
CS-Firm
SS DB DS
New Firm -- N
******************'

Continue reading...
 
Back
Top