如何用VB.net查询parse.com?

时间:2014-11-12 20:39:29

标签: .net vb.net parse-platform

我有一段时间在VB.Net中构建查询。 “Item”是我的解析类 “PLUNmbr”是该类

中的字符串列
Private Async Sub btnSyncToCloud_Click(sender As Object, e As EventArgs) Handles btnSyncToCloud.Click

Dim qItem As New ParseQuery(Of ParseObject)("Item")
qItem.WhereEqualTo("PLUNmbr", "0002")
Dim obj As Parse.ParseObject = Await qItem.FirstAsync

Debug.Print("PLUNmbr = " & obj("PLUNmbr").Value.ToString.Trim)
//This always prints out "0001" - which happens to be the first record in the class.
//No matter how I set the criteria - 0001 comes back.

end sub

1 个答案:

答案 0 :(得分:0)

该行:

qItem.WhereEqualTo("PLUNmbr", "0002")

修改 qItem,它只返回添加了过滤器的新实例。您需要将代码更改为:

qItem = qItem.WhereEqualTo("PLUNmbr", "0002")

我想你也可以这样做:

Dim qItem As New ParseQuery(Of ParseObject)("Item")
Dim obj As Parse.ParseObject = Await qItem.WhereEqualTo("PLUNmbr", "0002").FirstAsync