O'Reilly logo

.NET Framework 4.5 Expert Programming Cookbook by A.P. Rajshekhar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving large files (BLOB) in MS SQL Server using ADO.NET

SQL Server allows you to save data in binary format. By making use of this feature, we can save files of large size (more than 2 GB). Data having a large size are known as Binary Large Objects or BLOB. This recipe will detail the steps to use this feature in a .NET application. The saving of files at database level will be handled through a stored procedure. The application will pass the required data to the stored procedure and execute it.

We will be using image files for this recipe. Neither the application nor the stored procedure will check for uniqueness of the name of the file being saved. Checking for the uniqueness of the uploaded file is beyond the scope of this recipe.

How to do ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required