Using ADO.NET DS/EF with the new SQL Server 2008 "Filestream" type RRS feed

  • Question

  • I was wondering if anyone has some direction regarding the new "Filestream" type in SQL Server 2008, and if there is any sort of integration between this special type and ADO.NET EF/DS in Silverlight? 

    One issue that comes to mind is whether the binary file data is immediately retrieved by an ADO.NET query, as this would be very expensive in a query with many results.  For example, in my case, I am populating a datagrid with many results, but only want to load the file data when a user drills down into the details for a particlur line item.  Would there be any way to lazy load the Filestream, so that when a user drills down into the file data for a particular Entity, we could then load the Filestream?

    The way I think most developers currently handle file data is to just store it on the server's file system, and then create a db column in their table that contains the path to the file.  This works great for the "lazy" loading issue above, because the file would not be retrieved unless specifically requested.  And the query is inexpensive because it just contains the path to the file, not the file itself.  But the Filestream seems to be a more manageable, streamlined solution, if it can be used seamlessly with the ADO.NET EF/DS.

    Tuesday, December 2, 2008 10:10 PM


  • In V1, we were not able to support all the types (including FileStream, etc) in Ado .Net EF/DS. Its unlikely that we might be able to support these types in the next version of Ado .Net Data Services, but we are working on a feature right now, that will enable storing streams in the file system in the server file system.


    Having said that, EF might be able to support these types in their next version. I am not very sure about that. You might have to post this question in their forum and see what they have to say about this.




    Tuesday, December 9, 2008 5:50 AM