开发者

Getting a blob size without the blob itself

I have a table that has a blob column representing a file. I'd like to run a LinqToSql query that returns a name and description of the file, along with the fi开发者_如何学编程le size... but in the interests of not killing performance, I obviously don't want to download the whole blob!

var q = from f in MyFiles
        select new {f.Name, f.Description, f.Blob.Length};

appears to pull the entire blob from the DB, then calculate its length in local memory.

How can I do this so that I only get the blob size, without downloading the entire blob?


I think the best choose in your case is to store blob size in the separate column, when storing file to database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜