Kanchan Sharma
Kanchan Sharma

Reputation: 51

How to add multiple images to a single record in SQL Server using asp.net

I am working on a site and one of its requirement is to add multiple images to a single column of database along with other details.

This is the screenshot of my webform:

enter image description here

and this is my database table:

enter image description here

But I am confused about adding multiple images in a specific field of one row. Is it possible that a single record can have a field with multiple images stored in it? Please suggest a good solution to this problem.

Thank you

Upvotes: 0

Views: 1716

Answers (1)

Dai
Dai

Reputation: 155145

You can store multiple files together in a single blob or stream by using MIME Multipart formatting. See this RFC: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

Note that using a separate table with one record per image/file is a better overall solution because there is a large overhead in extracting files from a Multipart blob, making it slow and inefficient... so don't store files larger than a few kilobytes.

Upvotes: 1

Related Questions