17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5: <strong>FILESTREAM</strong> with ASP.NET and SilverlightLab 7: Displaying Thumbnail Images <strong>of</strong> Itemsfrom a <strong>FILESTREAM</strong> Database on an ASP.NETWeb PageIn this lab, we will create a web page that will display a list <strong>of</strong> items along with theirthumbnail images. We will use the web handler we created in the previous lab to fetchimages stored in the <strong>FILESTREAM</strong> column <strong>of</strong> a <strong>SQL</strong> <strong>Server</strong> database.To do this, we will:• create a stored procedure to fetch item details• add a new web form and a Grid View• create a data source that retrieves item information, and bind it to the Grid View• configure the Grid View• run and test the web page.Creating the stored procedure to fetch iteminformation<strong>The</strong> first step is to create a stored procedure that returns the list <strong>of</strong> all the items in theItems table. However, before you begin, add a few records to the Items table (I'll leavethis as an exercise for the reader – I have populated my sample table with four rows, withfour different products and their thumbnail images).194

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!