从伯爵Azure的查询返回的字符串数 [英] Count number of strings returned from Azure query

查看:166
本文介绍了从伯爵Azure的查询返回的字符串数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Andr​​oid的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆