I have a SQL Server 2008 database utilizing Filestreaming and all works fine and dandy apart from under one very strange circumstance. If i have my database on, say a laptop, on a locally installed version of SQL Server 2008 and am connected to the network all works fine. If i unplug the network cable, after a while the SqlFileStream class fails to initialize with a Win32 exception (everything else about connecting to the database works fine). If i start fresh without a network cable it will not work with the same error. If i plug a network cable in even with no network connectivity it works... take it out, nothing.
I'm connecting to the filestream in the usual documented method
SqlFileStream fileStream = new SqlFileStream(path,
context,
FileAccess.ReadWrite,
FileOptions.SequentialScan,
0);
geting the path and context from a stored procedure which generates them in the following
SELECT Data.PathName(), GET_FILESTREAM_TRANSACTION_CONTEXT()
FROM dbo.DocumentFiles
WHERE [File_ID] = @FileId
I'm getting the following error when creating the SqlFileStream instance
Win32Exception occurred The network location cannot be reached. For more information about network troubleshooting, see Windows help.
No inner exception.
I have tried so many things to resolve the issue with no luck. no one in google-land seems to have the same issue so obviously something silly I'm doing. If anyone can shed any light on this i would be most grateful.
James