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 Silverlight}catch (Exception ex){//Do something with the exception}finally{//Commit the transaction and close the connectionCmd.Transaction.Commit();cn.Close();}Listing 5-8:Saving item information to a <strong>FILESTREAM</strong> database.Running the applicationWe have successfully completed the coding for this lab, so it is time for us to run theapplication and see it in action: press F5 or click the Start Debugging button on thetoolbar. This will open the web page in a new web browser instance, as shown inFigure 5-3.Figure 5-3:<strong>The</strong> web page.Enter an item number and description, select an image file using the Browse button, andthen click Save to insert the information into the database.175

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

Saved successfully!

Ooh no, something went wrong!