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

Uploading files using Entity Framework and stored procedures

Using Entity Framework, you can accomplish all of the CRUD (Create, Retrieve, Update, and Delete ) operations without making calls to the stored procedures. However, in some cases, encapsulating CRUD operations within a stored procedure becomes necessary. In such scenarios, you can call a stored procedure from within your code as if you are calling any other method of C#.

In this recipe, we will use a stored procedure to upload image files to the database. We will call the stored procedures by using classes and methods generated by Entity Framework.

How to do it...

  1. Create a project of the type Windows Forms Application in Visual Studio 2012. Name it FileUpload.
  2. In Solution Explorer, right-click ...

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