View Full Version : Picture retrieval and storage
mariechristine
01-08-2004, 07:25 AM
I have the picture url. ex: "http://23.3.3.3/mypic.jpg"
I need to retrieve the image and store it in database as image.
How do i do that in c#? which data type is picture in C#? (in database picture data type is image)
sicarius
01-08-2004, 02:27 PM
Well. In databases the image type doesn't literally mean visual images. It means binary data. This meaning is also used in FTP.
You could just get the raw bytes of the jpeg and store them in the database in a field of type image.
How you do it depends on the dbms you are using. If it is MSSQL server, then look into the SqlClient classes. I beleive they are in the Data namespace.
khu19
02-04-2004, 03:11 PM
I would suggest storing the picture's path and filename inside the database instead of storing the actual image.
You need to use the
Systems.Drawing.Imaging library to work with images.
Image loadPhoto = new Bitmap("mypicture.jpg");
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.