devxlogo

Inserting Images to SQL Using a SP and N-tier App

Inserting Images to SQL Using a SP and N-tier App

Question:
I am in the process of creating an n-tier database application and am stuck at storing images to the SQL Server database. Any help would be appreciated.

Obviously, I need to read the image from the hard drive and store it to a variable (of what type?), and then pass it to my business layer, data access layer, and then the SP.

Answer:
The text datatype holds binary large objects, too, which is what you want to store. It’s done via the GETCHUNCK method in Visual Basic.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist