Displaying images in datagrid in VB.net

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 12
Reputation: Pja is an unknown quantity at this point 
Solved Threads: 0
Pja Pja is offline Offline
Newbie Poster

Displaying images in datagrid in VB.net

 
0
  #1
Sep 20th, 2007
Can any one please tell me how to retrieve image that i have stored in SQL SERVER 2000 and display the image in datagrid in VB.net 2003? I am able to display text data in datagrid but the picture cannot be display (in datagrid the picture is not shown but it display byte[]).

Any help will be appreciated. Thank you.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Displaying images in datagrid in VB.net

 
0
  #2
Sep 20th, 2007
Are you storing the path of the image in SQL or the actual image?
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Displaying images in datagrid in VB.net

 
1
  #3
Sep 20th, 2007
In .NET 2003 there is no built in column style for images, you will need to implement one yourself by deriving from DataGridColumnStyle. You have to implement the ExtractImageFromOleContainer() method of the DataGridImageClass.

If you need more help I can write a demo app. for you.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Displaying images in datagrid in VB.net

 
0
  #4
Sep 21st, 2007
So did you get any luck using my suggestion?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: Pja is an unknown quantity at this point 
Solved Threads: 0
Pja Pja is offline Offline
Newbie Poster

Re: Displaying images in datagrid in VB.net

 
0
  #5
Sep 21st, 2007
I have a table named Tool in SQL Server 2000 with 4 columns:
Tool_id
Tool_size
ToolImage - datatype Image ( which i store the actual image eg drill.jpg)
ImagePath - datatype varchar (which i store the image path eg D:\My Pictures\drill.jpg)

I'll be glad if you can tell me how to implement the ExtractImageFromOleContainer() method of the DataGridImageClass step by step or perhaps a demo app like you had offer.

Just for your information, im a beginner in VB.net programming.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: Pja is an unknown quantity at this point 
Solved Threads: 0
Pja Pja is offline Offline
Newbie Poster

Re: Displaying images in datagrid in VB.net

 
0
  #6
Sep 21st, 2007
I have a table named Tool in SQL Server 2000 with 4 columns:
Tool_id
Tool_size
ToolImage - datatype Image ( which i store the actual image eg drill.jpg)
ImagePath - datatype varchar (which i store the image path eg D:\My Pictures\drill.jpg)

I'll be glad if you can tell me how to implement the ExtractImageFromOleContainer() method of the DataGridImageClass step by step or perhaps a demo app like you had offer.

Just for your information, im a beginner in VB.net programming.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Displaying images in datagrid in VB.net

 
0
  #7
Sep 21st, 2007
I will try to create a sample app using your table Format.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 12
Reputation: Pja is an unknown quantity at this point 
Solved Threads: 0
Pja Pja is offline Offline
Newbie Poster

Re: Displaying images in datagrid in VB.net

 
0
  #8
Sep 23rd, 2007
thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC