473,387 Members | 1,512 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,387 software developers and data experts.

How to save html tags at SQL Server?

I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter
Nov 19 '05 #1
7 3169
You shouldnt have to do anything. As long as the characters, like quotes,
are escaped you should be fine.
What's the error?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dexter" <pr******@yahoo.com.br> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter

Nov 19 '05 #2
a little more information would be helpful,

1. what version of sql server
2. where is the error message being generated?
3. what html tags are you trying to encode?
Answer those questions and someone might be able to help you.

Nov 19 '05 #3
Dexter,

What error is being generated? How are you currently trying to do the
insert? Are you attempting to execute a string? Are you using a stored
procedure? If you are executing a string, you may be experiencing errors
related to characters such as a single quote that interrupt the SQL string.
It would be safer for you to use the SqlCommand object and define a parameter
with a specified type such as SqlDbType.Text or SqlDbType.VarChar (depending
on your needs). Then set the parameter's value property to the HTML and give
that a shot. The SqlCommand object will make assumptions and handle some of
the data that would normally be invalid when executing a string.

Thanks,
Ian Suttle
http://www.IanSuttle.com
"Dexter" wrote:
I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter

Nov 19 '05 #4
The error message is:
A potentially dangerous Request.Form value was detected from the client
(TextBox1="...imento do <b>ISS homologado</b...").
Dexter

"Curt_C [MVP]" <software_AT_darkfalz.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP10.phx.gbl...
You shouldnt have to do anything. As long as the characters, like quotes,
are escaped you should be fine.
What's the error?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dexter" <pr******@yahoo.com.br> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter


Nov 19 '05 #5
1. what version of sql server
- SQL Server 2000
2. where is the error message being generated?
- A potentially dangerous Request.Form value was detected from the
client (TextBox1="...imento do <b>ISS homologado</b...").
3. what html tags are you trying to encode?
- "Data de Vencimento do <b>ISS homologado</b>"

Answer those questions and someone might be able to help you.
Dexter
<dk****@gmail.com> escreveu na mensagem
news:11**********************@f14g2000cwb.googlegr oups.com...
a little more information would be helpful,

1. what version of sql server
2. where is the error message being generated?
3. what html tags are you trying to encode?
Answer those questions and someone might be able to help you.

Nov 19 '05 #6
Thats different. You need to turn off that check for that page then. Do a
google on that error, actually I think the error tells you exactly what to
do. It's just another tag to add to the header.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dexter" <pr******@yahoo.com.br> wrote in message
news:O7**************@TK2MSFTNGP15.phx.gbl...
The error message is:
A potentially dangerous Request.Form value was detected from the client
(TextBox1="...imento do <b>ISS homologado</b...").
Dexter

"Curt_C [MVP]" <software_AT_darkfalz.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP10.phx.gbl...
You shouldnt have to do anything. As long as the characters, like quotes,
are escaped you should be fine.
What's the error?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dexter" <pr******@yahoo.com.br> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter



Nov 19 '05 #7
You need to add the ValidateRequest="false" on the <%@Page .. %> directive.

"Dexter" wrote:
The error message is:
A potentially dangerous Request.Form value was detected from the client
(TextBox1="...imento do <b>ISS homologado</b...").
Dexter

"Curt_C [MVP]" <software_AT_darkfalz.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP10.phx.gbl...
You shouldnt have to do anything. As long as the characters, like quotes,
are escaped you should be fine.
What's the error?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Dexter" <pr******@yahoo.com.br> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I need to save a text with html tags in a SQL Server database. I'm using
server.htmlencode, but don't function.
A error is generate.

Somebody know how to resolve this problem?
Dexter



Nov 19 '05 #8

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

Similar topics

2
by: RickL | last post by:
I have an ASP application that uploads a specified file to the server. To retrieve the file, I simply assign the filepath and file to a hyperlink on the page. When you click "Save Target As" for...
5
by: Poster | last post by:
I have a script, its outputs are in HTML. It displays perferctly in a browser, however when I view source, it gives me the JS scripts, but I want to view the HTML output. Is there a way I can view...
7
by: joseph.inglis | last post by:
I have a web browser object on a form which I have set to edit mode and use the UCOMIConnectionPointContainer interface to hook in and catch events. All working sweetly. Except there...
0
by: a | last post by:
Save text file as html kloepper 17:42 23 Jul '04 I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
0
by: COMantilles | last post by:
Hi, Hi created a simple function to open a word doc on server then save it to HTML, ok for the result except that i would like to save it to "filtered" HTML without office's tags (word 2002...
3
by: needin4mation | last post by:
I have data I am reading from a database. I want to take that data, parse it, and put it in between html tags. When I have that row completed in between all the tags, then I want to save that...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
17
by: V S Rawat | last post by:
I joined this ng and tried to post my first message that had a small php code (HTML and all). my newsserver aioe.net rejected the post saying "HTML Tags". My message was in text format, not in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.