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