How to save html tags at SQL Server?

D

Dexter

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
 
D

Dexter

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


Dexter
 
D

Dexter

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
 
C

Curt_C [MVP]

You shouldnt have to do anything. As long as the characters, like quotes,
are escaped you should be fine.
What's the error?
 
D

dkode8

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.
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top