473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Decode html in SQL Server

I have an c#.net app which writes to a sql server db and in one table,
stores data with html coding. (string strNote =
HttpUtility.HtmlEncode(txtNote.Text);) I want to report on this data from
SQL Server using an Access adp application. Is there a way in SQL Server
that can decode the html so that I don't have text that shows up like this
on my report: >Subject: RE: my program
>Date: Thu, 30 Dec 2004 09:25:12 -0600

Thanks.
--Susan
Nov 19 '05 #1
6 4017
You have quite a problem on your hands. Not all HTML is text. Some is HTML
elements, such as tables, divs, etc. It is designed to be displayed in a
browser, which interprets it according to the rules of HTML. What would your
business rules be in regards to, for example, a table with 2 columns having
text in one column and an image in the other?

Bottom line is, the problem can be solved, but you need to more finely
define the business requirements before you can come up with a solution.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Susan Geller" <sg*****@cce.umn.edu> wrote in message
news:ct**********@lenny.tc.umn.edu...
I have an c#.net app which writes to a sql server db and in one table,
stores data with html coding. (string strNote =
HttpUtility.HtmlEncode(txtNote.Text);) I want to report on this data from
SQL Server using an Access adp application. Is there a way in SQL Server
that can decode the html so that I don't have text that shows up like this
on my report: &gt;Subject: RE: my program
&gt;Date: Thu, 30 Dec 2004 09:25:12 -0600

Thanks.
--Susan

Nov 19 '05 #2
Kevin,

The data that is entered into the one field in question is a simple note
field. There are lots of character type things like breaks and apostrophes,
but nothing like a table or a div. What would approach be given that kind
of set up?
--Susan

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
You have quite a problem on your hands. Not all HTML is text. Some is HTML
elements, such as tables, divs, etc. It is designed to be displayed in a
browser, which interprets it according to the rules of HTML. What would your business rules be in regards to, for example, a table with 2 columns having text in one column and an image in the other?

Bottom line is, the problem can be solved, but you need to more finely
define the business requirements before you can come up with a solution.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Susan Geller" <sg*****@cce.umn.edu> wrote in message
news:ct**********@lenny.tc.umn.edu...
I have an c#.net app which writes to a sql server db and in one table,
stores data with html coding. (string strNote =
HttpUtility.HtmlEncode(txtNote.Text);) I want to report on this data from SQL Server using an Access adp application. Is there a way in SQL Server that can decode the html so that I don't have text that shows up like this on my report: &gt;Subject: RE: my program
&gt;Date: Thu, 30 Dec 2004 09:25:12 -0600

Thanks.
--Susan


Nov 19 '05 #3
This needs to be done on the client.
Nov 19 '05 #4
Scott,

The client uses Microsoft Access. Can I do it in Access?

--Susan

"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:0F**********************************@microsof t.com...
This needs to be done on the client.

Nov 19 '05 #5
Well, I'm not sure what a "simple note field" is, but if you can identify
all the HTML markup that can be in it, you can use Regular Expressions to
replace these with the appropriate characters.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Susan Geller" <sg*****@cce.umn.edu> wrote in message
news:ct**********@lenny.tc.umn.edu...
Kevin,

The data that is entered into the one field in question is a simple note
field. There are lots of character type things like breaks and
apostrophes,
but nothing like a table or a div. What would approach be given that kind
of set up?
--Susan

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
You have quite a problem on your hands. Not all HTML is text. Some is
HTML
elements, such as tables, divs, etc. It is designed to be displayed in a
browser, which interprets it according to the rules of HTML. What would

your
business rules be in regards to, for example, a table with 2 columns

having
text in one column and an image in the other?

Bottom line is, the problem can be solved, but you need to more finely
define the business requirements before you can come up with a solution.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Susan Geller" <sg*****@cce.umn.edu> wrote in message
news:ct**********@lenny.tc.umn.edu...
>I have an c#.net app which writes to a sql server db and in one table,
> stores data with html coding. (string strNote =
> HttpUtility.HtmlEncode(txtNote.Text);) I want to report on this data from > SQL Server using an Access adp application. Is there a way in SQL Server > that can decode the html so that I don't have text that shows up like this > on my report: &gt;Subject: RE: my program
> &gt;Date: Thu, 30 Dec 2004 09:25:12 -0600
>
> Thanks.
> --Susan
>
>



Nov 19 '05 #6
I have never used access but I think that you can scrub the data on it's way
in using VBA. VBA has built in functions to decode html.
Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pavils Jurjans | last post by:
Hallo, I am working on multilingual web-application, and I have to be very sure about how the international characters are encoded and decoded in the client-server form requests. There's a...
1
by: Sherman H. | last post by:
I have to run a query to give a column a value based on a time range. Can I use DECODE? select decode(trans_date, trans_date>='01-Jul-2002' and trans_date<='30-Jun-2003','Fiscal2002', .....) as...
10
by: N | last post by:
What is the function in SQL that works like DECODE in Oracle?" Thanks, N
2
by: Chris | last post by:
Wondering if anyone can help me... I have a text node that has been HTML encoded. The text is has CDATA tags around it. The problem is I can't seem to decode the text. When the CDATA is gone, I...
4
by: Newbie | last post by:
How would I modify this form to encode *all* the characters in the 'source' textarea to the '%xx' format & place result code into the 'output' textarea? (cross browser compatable) Any help is...
0
by: cdonyi | last post by:
Hi I am looking for a clean way to scrub HTML encoded strings and display only certain tags back to the browser. I am thinking of using HttpUtility.HTMLEncode/Decode methods. My plan is to...
5
by: Jonas Åkermark | last post by:
Hello! I have a problem decoding the czech character: r The HTML code for this character is ř but when running Server.HTMLdecode on that string it just returns ř instead of the real char....
7
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I...
11
by: dan-x | last post by:
I am a novice to SQL Server, so this is probably a really easy problem to fix. I'm translating an Oracle query and need to change the 'decode' to something compatible. Everything I've read points...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.