HTML Saving to Database

C

csgraham74

Hi Guys,

I was wondering if someone could help me with a problem that im having.

Basically i have a html editor control and im using this to allow my
colleague to create html documents. I want to save this html info as a
string into my database. the problem arises however due to quotation
marks both double and single within my html. I have seen html before
where it does not have the actual quotation mark but somethinp like
"&lquo" (this is probably wrong)

Is there a class in dotnet that will do this for me ?????

any help appreciated


Colin Graham
 
K

Kevin Spencer

What exactly is the problem? There is no reason why you can't store the HTML
in the database exactly as it is.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
 
C

csgraham74

thanks kevin

do you think its just a matter of stripping out the double quotes with
some sort of replace method ???

im still curious on how to convert the html into the other html format


any ideas or pointers ???

thanks again

colin
 
K

Kevin Spencer

You don't need to strip out anything. You can store the HTML in the database
exactly as it is.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
 
C

csgraham74

well that just wont work - it simply throws me an error in my SQL
string. i think this is because im using double quotes in my html. what
is the best way to do this ???

thanks again
 
S

SteveO

You need to use SQL parameters -- don't build the SQL statement by
hand, it's not safe.

dim ParmHTMLtext as new sqlparameter

....

command.parameters.add(ParmHTML)


Steve
 

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