Changing HTML encoding in the DB?

Discussion in 'ASP .Net' started by darrel, Jan 24, 2007.

  1. darrel

    darrel Guest

    I'm migrating a table of web site content into our CMS. Our CMS (custom
    built) stores all HTML in the DB as encoded html.

    This one particular table, however, has the HTML stores as unencoded HTML.
    I'd like to make this table consistent with the rest of the site data in all
    the other tables.

    The only way I can think of to do this is to write an ASPX page that queries
    all records, then loops through them all doing an UPDATE statement. Just
    wondering if there's a better/faster/easier way?

    -Darrel
    darrel, Jan 24, 2007
    #1
    1. Advertising

  2. "encoded" is a sort of ambiguous term. It could mean HtmlEncoded, etc. But if
    it's already in the database, there's no way around using an update
    statement. Whether you choose to do this with a "single use" ASP.NET page,
    console app, or whatever, you are going to have to get out the column data,
    re-encode it (whatever that means to you) and update the column with the new
    data, unless you want to write a SQL Server 2005 CLR - hosted .NET class to
    be used as a stored proc to do it.
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "darrel" wrote:

    > I'm migrating a table of web site content into our CMS. Our CMS (custom
    > built) stores all HTML in the DB as encoded html.
    >
    > This one particular table, however, has the HTML stores as unencoded HTML.
    > I'd like to make this table consistent with the rest of the site data in all
    > the other tables.
    >
    > The only way I can think of to do this is to write an ASPX page that queries
    > all records, then loops through them all doing an UPDATE statement. Just
    > wondering if there's a better/faster/easier way?
    >
    > -Darrel
    >
    >
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jan 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,807
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. changing string encoding

    , Sep 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    465
  3. John Dalberg
    Replies:
    2
    Views:
    1,496
    Juan T. Llibre
    Oct 17, 2005
  4. Replies:
    1
    Views:
    23,320
    Real Gagnon
    Oct 8, 2004
  5. Replies:
    2
    Views:
    357
Loading...

Share This Page