New Line character storage in ntext field in SQL 2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • babai28
    New Member
    • Jul 2008
    • 59

    New Line character storage in ntext field in SQL 2000

    Hi there,
    I have a multi line text box in a data entry form. The data entered in this field is being stored as ntext column in a table.
    This data is visible in other form in DataGridView. Where the newline character is replaced by ugly, obnoxious "squares". I remember having used this with oracle blob column where it did not create a porblem.
    Agagin when this fetched in a multiline textbox for editing purpose it displays "squares".
    Hw do I handle this. I tried googling but not much to my rescue. Any pointers or ideas would be appreciated.
    Thanks for your time.
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    have you tried it with nvarchar,varcha r....

    Comment

    • babai28
      New Member
      • Jul 2008
      • 59

      #3
      While googling I found that even these fields don't help.
      Last edited by babai28; Jan 25 '10, 12:54 PM. Reason: Grammatical error

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I store newlines all the time in text and varchar and don't have any issues with squares

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          It could be your choice of font.
          For example I use a font called "crisp" which is deliberately designed as a programmer's font with lines through the zeros and newline characters appear as a tiny NL

          Try changing your font to something standard like Arial and see if it still appears that way.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            You should not see the boxes in a field that allows new lines (like a multiline textbox)

            Comment

            • tlhintoq
              Recognized Expert Specialist
              • Mar 2008
              • 3532

              #7
              'should' being the operative word.
              I don't know much about how databases can convert text. Is it possible the newline is being changed into something else? A newline in one OS is not necessarily a newline in another OS.
              Can you run a debug version of your application and look at the actual bytes of the data and confirm it is truly the newline you expect and not just a carriage return for example.

              Comment

              • babai28
                New Member
                • Jul 2008
                • 59

                #8
                Hi All,
                Thanks for your replies. The problem is solved
                by setting the datagridViewCol umn wrap mode property to true.
                Thank you once more.. all of you..

                Comment

                Working...