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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5: <strong>FILESTREAM</strong> with ASP.NET and SilverlightOpen Visual Studio and create a blank solution by selecting File | New | Project… fromthe menu. In the New Project dialog box, under Other Project Types, select VisualStudio Solutions and then Blank Solution. Click OK to create the new, blank solution.In Solution Explorer, right-click the solution and select Add | New Project…. Select theASP.NET Empty Web Application project template. In this lab, we will give this projectthe name Presentation. Click OK to create this new project as part <strong>of</strong> the solution.Follow the same process for adding a second new project to the solution, this timeusing the Class Library template. Name this project DataAccess. Delete the defaultClass1.cs file from the project. Repeat this process one more time to create anotherclass library with the name Domain.We will now add references to the appropriate projects. <strong>The</strong> web application will call intothe data access layer to retrieve information from the <strong>SQL</strong> <strong>Server</strong> database. Both the webapplication and the data access layer will use the domain objects. We must therefore addthe following references in the Presentation project:• Domain• DataAccess.And in the DataAccess project:• Domain• System.Configuration.In order to start the web application showing an image using the handler we will develop,we must change the start page. Right-click on the web application and select Properties.In the Web tab, change the Start Action to Specific Page and enter GetItemImage.ashx?itemID=1 as the value. We are now ready to start coding the solution.206

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

Saved successfully!

Ooh no, something went wrong!