backslash

J

janet

Hi

I created a table with varchar field where i want to store
the path of an image.

I will then use this file to retrieve this image on my
browser. Everything goes fine when i use a simple html
command as :
<img src="C:\Inetpub\wwwroot\MyWeb\images\one.jpg"
height="200" width="200">

this is a hard-coded path. Hence no problem.

But when I store in the database path value:

insert into story_table values
(1, 'Language', 'C:\Inetpub\wwwroot\MyWeb\images\one.jpg',
'C:\Inetpub\wwwroot\MyWeb\images\two.jpg',
'C:\Inetpub\wwwroot\MyWeb\images\three.jpg',
'C:\Inetpub\wwwroot\MyWeb\images\four.jpg', 'variation','cu
lture',
'tamil','chinese','english','german','hindi','malyalam','si
nglish','urdu');

'\' is not stored????????? why is this so ? hwo can i
store the complete using backslah. Currently it is storign
as:
C:InetpubwwwrootMyWebimagesone.jpg
instead of:
C:\Inetpub\wwwroot\MyWeb\images\one.jpg

any idea why is this happening?

thanks
janet!
 
G

Graham

Hi Janet

Try replacing the backslash character with its unicode equivalent which is
UNICODE(5C). I think the datatype of your field might need to be nvarchar to
use unicode. I have never done that myself so I don't know if it works...

Alternatively, if all of your images are stored in the same folder could you
not just store the image name and perhaps use relative url in your code?

Hope this helps


Graham
 

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

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top