从伯爵Azure的查询返回的字符串数 [英] Count number of strings returned from Azure query
问题描述
我想在我的Android的Java code从我的Azure数据库表计算行数。不幸的是内置于蔚蓝的库中没有计数()方法。最接近它是includeInlineCount()方法。我用code以下行:
I am trying to count the number of rows from my azure database table in my android java code. Unfortunately there is no count() method built into the azure library. The closest thing to it is the includeInlineCount() method. I used the following line of code:
final MobileServiceList<Crime> result = mToDoTable.includeInlineCount().execute().get();
哪个返回每个行的第一列的值。的结果
的价值看起来是这样的:
Which returns the value of the first column for each row. The value of result
looks something like this:
[column1_row1_String, column1_row2_String, column1_row3_String]
我怎么能提取字符串的数量从数值结果?
How can I extract the number of strings from the value result?
推荐答案
据类 MobileServiceList
来源$ C $ C,你可以尝试code下面使用方法 getTotalCount()
。
According to the source code of Class MobileServiceList
, you can try the code below using the method getTotalCount()
.
final MobileServiceList<Crime> result = mToDoTable.includeInlineCount().execute().get();
int count = result.getTotalCount();
这篇关于从伯爵Azure的查询返回的字符串数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!