Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Insert Description into database that contains HTML

  1. #1
    macecase is offline Member
    Join Date
    Feb 2011
    Posts
    44

    Default Insert Description into database that contains HTML

    If I were to insert the contents of the Description field in SQL and the data being inserted is HTML, how do I get it to render as HTML and not have the actual HTML tags show up in the description?

    If I do this now, I have to go through the RAD and cut the description, click HTML and past in there to get it to render properly.

  2. #2
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    This works for us:

    Code:
    update Product set Description='<strong><u>hello world</u></strong>' where ProductID=123
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Just make sure you escape single quotes!
    Code:
    update Product set Description='<strong><u>Hello''s and Googdbye''s</u></strong>' where ProductID=123
    To escape a single quote just add another single quote (don't use a double quote it has to be an extra single in front of the symbol)
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    macecase is offline Member
    Join Date
    Feb 2011
    Posts
    44

    Default Ok, works

    Ok, that works just fine.

    I realized some of the data that I was previously trying to do this was pretty messed up (encoding) so that is what caused my issue I was so confused about.

    Anyway, your solution worked with better data!