Load Image,SQL SERVER [IMAGE ]

Posted by Raja_89 under C# on 6/16/2014 | Points: 10 | Views : 487 | Status : [Member] | Replies : 2
Hai
In sql Server i am storing images for various ids
Ex:
id
1 aa.jpg
2 bb.jpg
3 cc.jpg


In my Form
I am retrieving all images and assigning it using this memory stream using individual memory stream
and i am assigning in Activate event


For id1

picturebox1.backgroundimage=Image.FromStram(objmes);
for id2

picturebox2.backgroundimage=Image.FromStram(objmes2);
for id3
picturebox3.backgroundimage=Image.FromStram(objmes3);


....upto
for id24

picturebox24.backgroundimage=Image.FromStram(objmes24);


like this
Question
Is it possible to retrieve all images based on ids
and assign it to the control
Is there any alternative which decreases my code

Regards




Responses

Posted by: Bandi on: 6/16/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
http://geekswithblogs.net/dotNETvinz/archive/2009/04/24/displaying-image-to-image-control-based-on-user-selection-in.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 6/16/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
http://www.aspnettutorials.com/tutorials/database/saving-retrieving-image-cs/#

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response