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 SilverlightFigure 5-1:Creating a new project.Visual Studio automatically creates a web page named default.aspx, and we will usethat page for this lab.Adding a database connection string<strong>The</strong> next step is to add a database connection string to the configuration file <strong>of</strong> the webapplication, web.config. Locate web.config in the Solution Explorer, and double-clickon it to open the configuration file in the Visual Studio editor.Locate the section, connectionStrings, and add a connection string that points to the<strong>FILESTREAM</strong> database you would like to use for the labs. Listing 5-3 shows how the codeshould look after the connection string has been added to the configuration file (but youshould use the data source appropriate to your own connection).Ensure the connection string uses Windows authentication (IntegratedSecurity=SSPI); we have already learnt that Windows authentication is required toaccess the <strong>FILESTREAM</strong> data using Win32 or Managed APIs.168

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

Saved successfully!

Ooh no, something went wrong!