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

Using functions that return tables as return values

In Microsoft SQL Server 2008 and later versions, we could create functions that return tables as return values. These functions are known as Table Valued Functions . Until Entity Framework Version 5, there was no way to use such functions with Entity Framework. However, with Entity Framework 5 (Visual Studio 2012), it is possible to use Table Valued Functions.

In this recipe, we will see how to do so. The function that we will use will return the details of files uploaded by a user, and we will display the details on DataGridView.

How to do it...

  1. Launch SQL Server Management Studio 2012.
  2. Open the database named CookBook.
  3. Next, add a Table Valued Function that will retrieve data from tb_FileStorage ...

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