Search code examples
sqlconnection-stringfilestreamaccess-denied

SQL Filestream Access Denied


I'm attempting to implement BLOB Filestream for uploading and downloading files to the SQL database. Problem is I get Access is Denied error when I attempt to wright to the file. I'm using this as the connection string.

<add name="connectionname" connectionString="Data Source=lceinforme;Initial Catalog=DEVDB;Persist Security Info=True;User ID=username;Password=password;Max Pool Size=5000" providerName="System.Data.SqlClient" />

From what I've looked up and understand is that I can't use this approach? I keep reading using Integrated Security, but I don't think I can connect that way. This has me stumped.


Solution

  • If this is SQL Server 2008, then I believe that you have to use a Trusted Connection in order for Filestream to work. You are specifying a Username and Password in your connection string, which means that you are using a SQL Login, and not a Trusted Connection.

    If this is a later version of SQL Server, then ... (sorry got interrupted) ... it depends on the SQL Server settings.

    Yes, Windows/AD Impersonation should work (however, SQL Server Impersonation probably will not).