ASCII Text in SQL2k


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ASCII Text in SQL2k

  1. #1
    Roger Guest

    ASCII Text in SQL2k


    Here's my question...I have a Rich Text control bound to a field in SQL2k.
    When I append data to the field from the control, the value from the rich
    text control's .text property is surrounded by ASCII code relating to the
    font parameter, et al of the control.

    What is the best way to prevent the control from appending this ASCII information
    to the SQL2k field.

    Thanks
    Share on Google+

  2. #2
    Rob Vieira Guest

    Re: ASCII Text in SQL2k

    Rich Text Format (which is used by the Rich Text control) is a tag based
    format. Essentially, it has some definite similarities to HTML in terms of
    how it notes formatting issues. Since you are using an RTF control, you're
    getting RTF information.

    Since you are using binding, you don't really have much control over what
    property the data is bound to. For the RTF control, it binds to the TextRTF
    property instead of the Text property. If you want only the actual text
    stored, then you need to either use a straight text control or get away from
    binding and use straight code to store the Text property. As an alternative,
    you could go through the process of creating your own custom control by
    essentially subclassing the RTF control. That's not a huge deal for
    something as simple as what you want, but is also not trivial if you haven't
    done it before.

    My recommendation? Write the ADO (or your object model of choice) code to
    write the text property out directly rather than binding. It will meet your
    need better and perform better to boot.

    --
    Rob Vieira MCSD, MCT, MCDBA
    www.ProfessionalSQL.com

    "Roger" <rmullins@ups.com> wrote in message news:3a6ca02c$1@news.devx.com...
    >
    > Here's my question...I have a Rich Text control bound to a field in SQL2k.
    > When I append data to the field from the control, the value from the rich
    > text control's .text property is surrounded by ASCII code relating to the
    > font parameter, et al of the control.
    >
    > What is the best way to prevent the control from appending this ASCII

    information
    > to the SQL2k field.
    >
    > Thanks



    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center