本文介绍了[已解决] EntityDataSource.CommandText中的嵌套选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

当我在entitydatasource.CommandText中使用此选择时:

Hi.

When I use this select in a entitydatasource.CommandText:

CommandText="SELECT it.[LiteratureID], it.[ReleaseDate], it.[Title], it.[Text], it.[ThreadID], it.[Added], (SELECT COUNT(fp.PostID) FROM ForumPosts AS fp WHERE fp.ThreadID = it.[ThreadID] AND fp.Status = 1) AS Posts FROM Literature AS it WHERE it.[Status] = 4 ORDER BY it.[ReleaseDate] DESC SKIP 5 LIMIT 1"



当我绑定数据时,我得到了:



I get this, when I bound the data:

System.Collections.Generic.List`1[System.Data.Common.DbDataRecord] 



应该是数字.

更新:
由OP自己解决.



It should have been a number.

UPDATE:
Resolved by OP himself. Posted as an answer.

推荐答案




这篇关于[已解决] EntityDataSource.CommandText中的嵌套选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 13:56