|
-
Feb 16th, 2006, 09:39 AM
#1
Thread Starter
Junior Member
how to store image path in database
i want to store image path (eg: c:\myproject\myphoto\0001.jpg) to my database
and show it in picture box
store in my db like this
ID: 001
photo: 001.jpg (rename photo file name to ID + .jpg)
ID:002
photo: 002.jpg
anone have and toturial or example ?
thanks again
ekkapop
-
Feb 16th, 2006, 09:45 AM
#2
Re: how to store image path in database
Do you mean you actually want to save the image itself, as opposed to file path?
-
Feb 16th, 2006, 10:05 AM
#3
Re: how to store image path in database
If you want just the paths, then build your strings, insert them into the database and rename your files. It should be fairly straight forward with System.IO.
-
Feb 16th, 2006, 10:37 AM
#4
Thread Starter
Junior Member
Re: how to store image path in database
i mean to
1. copy image file into myapplication path/photo/
2. file name is equal to ID
3. resize image : )
can you give me an example or toturials ?
-
Feb 16th, 2006, 10:54 AM
#5
Frenzied Member
Re: how to store image path in database
For 1 and 2 look at the IO.File namespace. It has a Move procedure which you can use to move and rename.
example
VB Code:
IO.File.Move("c:\myPic.jpg", Application.StrartupPath & "/Images/001.jpg")
And check this out for resizing the image
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|