SQL Server-based asp.net image storage technology

Source: Internet
Author: User

1 Introduction

The advent of the internet era, making a variety of internet-based applications, most of the application system will use the image data, need to display the picture in the user interface. Here is an implementation method that stores pictures in a folder. then display as required. The implementation step is to store the additional information of the picture path and other records in the database, while the real picture file is stored in a folder. This method is a good solution.

2 processing mode of the picture

There are two ways to handle a picture: The ① image data is stored directly in the hard disk in a file format, and the record in the database is saved with additional information (path, filename, comment ...) ; ② pictures are stored directly in the database. There are pros and cons to each of these two ways. Picture files stored in the database for ease of management and maintenance, and the hard drive may be deleted because of accidentally delete picture files, and make the data inconsistent: But the picture in the database is not easy to modify editing, but also cause the database reading data when I/O consumption, but on the hard disk will not cause this problem So for small files, recommended in the database for easy management, and for large files, and can not be placed in the database, otherwise the database table will produce a large number of fragments of data files.

3 Image Storage Methods

The system uses ASP. NET and SQL Server database to implement the storage of pictures. Store the picture in the directory specified by the hard disk, storing the relative storage path of the picture and other ancillary information in the database. The language used in the development platform is VB, and the database access technology is AD0. NET impressive according to the access mechanism is AD0. NET in the OLE DB mechanism.

3. 1 Establishment of database tables

For picture storage in the entire picture management system, a Picture content table (MYIMG) needs to be established, as shown in table 1.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.