Routine: Asp.net saves the large file to the image field of MSSQL and displays the progress information in real time.

Source: Internet
Author: User
When saving large files to MSSQL in Asp.net, the following two key problems need to be solved:

  1. Files must be stored in MSSQL in multiple parts;
  2. When the file is large, it takes a long time to save the file to MSSQL. The ASP. NET page may encounter a timeout error and cause the operation to fail.

The following two articlesArticleThe above two problems are well solved:

  1. How to read and write a file to and from a blob column by using chunking In ADO. NET and Visual C #. net
  2. Executing long running operations-Part II

Article 1 solves the problem of time-out errors caused by processing tasks for a long time using multiple threads. This article provides a practical example based on the above two documents for your reference.
Routine download: http://files.cnblogs.com/bestcomy/FileToMSSQL.rar

Routine installation steps:

  1. Decompress filetomssql.rar and set the decompressed folder to a virtual directory;
  2. Make sure that you have a connectable MSSQL with the northwind database. In this example, the categories data table is used;
  3. Make sure that the connstr database connection string in the <etettings> Configuration section of Web. config In the example is correct, which corresponds to your own MSSQL environment.
  4. Unexpectedly, you can use this routine to access default. aspx under the filetomssql virtual directory through IE.
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.