Q

Retrieve images from SQL Server and store in VB.Net

Having difficulty retrieving images from a SQL Serve database to a VB.Net application? Get best practices to retrieve, store and manage SQL Server images.

I'd like to know how to retrieve data from blob tables more quickly. When I retrieve data to my VB.Net application from SQL Server, it's taking too much time. What's the best way to do this?

While SQL Server is capable of storing images in blob columns, the retrieval of images from the database does incur...

certain overhead that you have already noticed. For that reason, many high performance Web sites store only image names and path-to-the image folders. The application then retrieves the image from the file system, rather than pulling it from the database. You didn't provide many details about how the application works or what it does with images. But, based on what I know, I would recommend storing path-to-image folders in a reference table, and then have a table that stores image names and any additional details you may need.

If you move images to another folder, you just modify the path to the image folder. Using this approach also makes image management much easier since you can easily preview, resize or move images stored in the file system. Storing them in the database often requires a lot of custom coding to implement image management. So, unless you have some really unique requirements, in most cases you are better off with images in the file system and image locations in the database.

This was last published in December 2007

Dig Deeper on .NET Development for SQL Server

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

2 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Dim command As New SqlCommand("select img from imgtable where id=1", cnn)
Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())

full source .. http://net-informations.com/vbprj/dataset/retrieve-image.htm

steve
Cancel
Please help me.
How to retrieve image from SQL Server with VB.Net by using Dataset wizard (DatabaseDataSet.xsd)
Cancel

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close