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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -