filestream - Best approach for a Binary column with LINQ to SQL -


My SQL 2008 table, let's call it tblDocument, after the name, the creator, the serial number, a "DocumentContent" varbinary,

I am using SQL from LINQ if I am retrieving multi-megabyte binary for each line without one interface, then it is best to complete it What's the way Is there a way to do this, as long as I do not read from the property, or something like this, then the filestream is not used?

Thanks

You can use Linq to create an anonymous object Not including document content columns. Like this: Select new {item.ID, item.name, item.creator, item.sequenceNumber} from the item in

  var list = db.tblDocument;  

Then use the ID to retrieve the document content later:

  var content = db.tblDocument Where (x = & gt; x.id == MyRowID). Select (x = & gt; x.DocumentContent). Single ();  

Comments

Popular posts from this blog

asp.net - Change the driver in the connection string to a data source in VB.Net -

Getting started consuming web services in a Ruby on Rails 3 application -

unix - Listing all shared memory segments used by a process on AIX5.3+ -