Basic Example of using the ASP.NET FileUpload to Save into a Database

Here is a super-simple bare-bones example of an ASP.NET Web form page in C# that uses the .NET FileUpload component to allow a user to upload a file into a SQL Server database table. I’ve put this together as a template to show just how easy it is to do and how few lines of actual code the process actually requires. Surprisingly the examples I found online and at the Microsoft support site were incomplete or had errors, so this is my attempt at making things clear. Continue reading “Basic Example of using the ASP.NET FileUpload to Save into a Database”

C# Example Code to Save and Resize Images from your Database to a System Folder

In this example I will show how to use C# in a WebForm to read out a series of pictures from a database table, resize the pictures to a standardized width, and then to save each image as a JPEG to a folder on your local file system. The code assumes that the pictures are coming from your database as JPEG format images, but you can easily adjust the code to dynamically save each image by its type if you have this data stored in your database. Continue reading “C# Example Code to Save and Resize Images from your Database to a System Folder”