SQL INsertion problem

L

Lars

Hi

I have the following problem. I want to add the following text in a FormView
for adding links easaly to the database I have on my homepage. But I get an
error about possible string insertion. When enter the string from the ID
every thing goes fine. If I view the field in a DataLost it outputs as the
HTML code I want but when I use a FormView or DetailsView I get the HTML
code written on the screen. What am I doing wrong, how do I insert SQL
commands to a database and then select them and print them out as HTML code
in the outprinted aspx file at the client and not HTML code in the browser.

I do use Parameterised values. Some how I must make sure to convert the
illegal characters to HTML excape sequences and then back again. How is this
done?

Here's the string I want to use

<p align="center"><a
href="http://www.rosoft.se/private/music/lrband/eget/100_Funky_12.mp3">100_Funky_12.mp3</a></p>

Yours
Lars

BTW
It's my own music.
 
M

Misbah Arefin

to convert html to escape sequences you need to encode/decode it you can use
Server.HtmlEncode and Server.HtmlDecode functions
 
L

Lars

Hi

When I think about it the problem is probably not ASP.NET. I would guess the
problem is defandant of the SQL Database. In this case SQL Express. Does any
one know how to add escape characters to SQL fields in SQL Express. Similar
to what you do in C/C++ as "This is a string with double quotes \" backsladh
\\ and line feed \n".

Can I write a Jaca Script function that converts this and then call that
function in stead of Eval("HTM")?



Lars
 

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

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top