Click here to Skip to main content
11,721,289 members (80,904 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WinXP SQL-server-2005 VS2005 , +
I have created a form in which there are various values such as Name, Address, Date of Birth etc. The user is also allowed to select an image in a picture box.
I want to insert these values along with the Image into database in appropriate columns.
Any help is appreciated
Posted 5-Apr-10 10:00am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Serialize the image as a byte array (up to you how you want to do that). Then insert it into a column of type varbinary(max) or image. Those data type names are a bit misleading.... the data type "image" actually means byte array (as does varbinary). When you get the image from the database, you'll need to deserialize it to use it as an image again.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can store images into database by converting image into bytes and storing these bytes in column

read this article for reference
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 510
1 OriginalGriff 249
2 Mika Wendelius 170
3 F-ES Sitecore 80
4 cyycoish 70
0 Sergey Alexandrovich Kryukov 2,209
1 OriginalGriff 969
2 F-ES Sitecore 660
3 Maciej Los 609
4 Richard MacCutchan 560


Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 6 Apr 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100