473,503 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL INsertion problem

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.


Feb 14 '08 #1
2 1107
to convert html to escape sequences you need to encode/decode it you can use
Server.HtmlEncode and Server.HtmlDecode functions

--
Misbah Arefin

"Lars" wrote:
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.


Feb 14 '08 #2
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
"Misbah Arefin" <Mi**********@discussions.microsoft.comskrev i meddelandet
news:03**********************************@microsof t.com...
to convert html to escape sequences you need to encode/decode it you can
use
Server.HtmlEncode and Server.HtmlDecode functions

--
Misbah Arefin

"Lars" wrote:
>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.



Feb 14 '08 #3

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

Similar topics

20
3831
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in...
10
2706
by: Anton.Nikiforov | last post by:
Dear all, i have a problem with insertion data and running post insert trigger on it. Preambula: there is a table named raw: ipsrc | cidr ipdst | cidr bytes | bigint time | timestamp...
5
6036
by: John N. | last post by:
Hi All, Here I have a linked list each containing a char and is double linked. Then I have a pointer to an item in that list which is the current insertion point. In this funtion, the user...
4
1578
by: Andrix | last post by:
Hi, I have a table with 20.000.000 of tuples. I have been monitoring the performance of the insertion and updates, but not convince me at all. The table have 30 columns, what and 12 of it, are...
3
1485
by: Franco Perilli | last post by:
I've compiled this code and no problems, but when I run the program, it prints only the last entry i've inserted. Looks like a problem in the sorted insertion algorithm. Can u help me plz? ...
6
16116
by: Julia | last post by:
I am trying to sort a linked list using insertion sort. I have seen a lot of ways to get around this problem but no time-efficient and space-efficient solution. This is what I have so far: ...
2
7348
by: B. Williams | last post by:
I have an assignment for school to Overload the operators << and >and I have written the code, but I have a problem with the insertion string function. I can't get it to recognize the second of...
1
1995
by: teo | last post by:
Hallo, I'm performing a mass insertion from a text file to a db table with AdoNet commands, like this: myCommand.CommandText = "BULK INSERT ..." from a Win form no problem
5
2594
by: phiefer3 | last post by:
I'm currently a student, but this problem isn't directly related to what I have to do on an assignment. It's just a problem I've had with some supporting features. First of all, I'm using MSVS...
9
2052
by: python_newbie | last post by:
I don't know this list is the right place for newbie questions. I try to implement insertion sort in pyhton. At first code there is no problem. But the second one ( i code it in the same pattern i...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
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,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.