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.

Recommended Answers

All 7 Replies

Are you storing the path of the image in SQL or the actual image?

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.

commented: Kind and helpful +11

So did you get any luck using my suggestion?

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.

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.

I will try to create a sample app using your table Format.

thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.