Storing images in SQL Server using C #

I want to store images of my employees with their profile data in SQL in a SQL Server database, but I have the following caveats:

Should I compress images or not, and if so, can the community provide me with sample code or guide me to a guide that can help me with this.

How to get images efficiently? I am afraid of asp.net application performance issues. I think that with thousands of employee records, the system can stop or slow down.

+3
source share
5 answers

sql . .

+2

Sql Server , , , :

- , - Sql ( , db, ), , 1-to1 . , . , , .

+1

-, ... , SQL Server .

, . SQL Server (.. ) , asp.net , .

+1

(, JPEG PNG) , , RAW- , . , , 400 400 . , , , . , , , , - .

0

If you are on SQL Server 2008 or higher, you can use the filestream function, which is similar to the best of both worlds. It saves the image in the file system, but has it under the control of transactions and is also included in your backups when they are made.

If you are not in 2008 or higher, I would say, to save images to the database, see this old white Microsoft document for my reasons.

http://arxiv.org/pdf/cs.DB/0701168

0
source

Source: https://habr.com/ru/post/1745811/


All Articles