开发者

Does the 'Datalength' command from T-sql have a c# Lambda equivalent?

In T-SQL, I can write:

select datalength(somec开发者_StackOverflow社区olumn_that_is_defined_as_text) from somedatabase

and it returns the length, in bytes, of that column.

Can this be done in using a Lambda expression?


It looks like they added it in .Net 4.0

You should be able to add it to 3.5 at least by using EdmFunctionAttribute on your own function call (I'm not finding a good example of this right now)

EdmFunctionAttribute is .Net 4.0 too. So I can't find any way to achieve this in .Net 3.5 Lambda statements.


Maybe use Encoding.GetBytes(MyColumnValue).Length on the values?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜