Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Unanswered: Retrieval of formated data

    Hello there,

    I’m having a little setback, I have a database and I need to retrieve some data from a table and one of the fields is a nvarchar. The thing is when I call the query the result makes the “enters” disappear and in this case the formatting of the text is essential. Can anyone tell me how can I retrieve this data into a table without losing enters?

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Try getting the results in text, rather than in grid format.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i think i understand what you're asking, although you didn't ask it very clearly

    when you run your query, the data is retrieved from a database table, and now you want to place that data into an html <table>

    the line feeds (which you call "enters") don't actually disappear, they're still there (as you can verify by viewing the hmtl source)

    however, they don't "work" (break to the next line) because html regards line feeds as white space

    what you'll have to do is replace each line feed character with the string '<br>'

    make sense?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •