I have a SQL Server 2008 database using Filestreaming, and everything works fine and dandy apart from one very strange circumstance. If I have my database, say, a laptop, on a locally installed version of SQL Server 2008, and I'm connected to the network, everything works fine. If I disconnect the network cable, after a while the SqlFileStream class will not be initialized with a Win32 exception (everything else about connecting to the database works fine). If I start a new one without a network cable, it will not work with the same error. If I plug in a network cable even without a network connection, it works ... take it out, nothing.
I connect to a file stream in a regular documented method
SqlFileStream fileStream = new SqlFileStream(path, context, FileAccess.ReadWrite, FileOptions.SequentialScan, 0);
getting the path and context from a stored procedure that generates them in the following
SELECT Data.PathName(), GET_FILESTREAM_TRANSACTION_CONTEXT() FROM dbo.DocumentFiles WHERE [File_ID] = @FileId
I get the following error when creating an SqlFileStream instance
A Win32Exception has occurred. Network location could not be reached. For more information on network troubleshooting, see Windows Help.
There is no internal exception.
I tried so many things to solve the problem without any luck. nobody in google-land seems to have the same problem, so obviously something stupid is what I'm doing. If anyone can shed light on this, I would be very grateful.
James