Facebook C#使用多重查询结果

Facebook C#使用多重查询结果,c#,.net,facebook-c#-sdk,facebook-fql,C#,.net,Facebook C# Sdk,Facebook Fql,我正在使用多查询来获取好友签入。我让查询按预期返回数据,但我要做的是创建一个DataTable,其中包含来自每个查询的元素。我只有3个结果,但数据中至少有100个。我不确定我做错了什么,我知道我的循环不正确。具有讽刺意味的是,3是查询的数量。我我肯定这是我的作品,但我不确定我应该在上面循环什么。请帮忙 dynamic resultCheckins = fb.Get("fql", new { q = new { friends_chec

我正在使用多查询来获取好友签入。我让查询按预期返回数据,但我要做的是创建一个DataTable,其中包含来自每个查询的元素。我只有3个结果,但数据中至少有100个。我不确定我做错了什么,我知道我的循环不正确。具有讽刺意味的是,3是查询的数量。我我肯定这是我的作品,但我不确定我应该在上面循环什么。请帮忙

dynamic resultCheckins = fb.Get("fql",
   new
   {
       q = new
       {
           friends_checkins = "SELECT author_uid, coords, timestamp, page_id, message FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me())",
           users = "SELECT uid, name, pic_small from user where uid IN (SELECT author_uid FROM #friends_checkins)",
           resultCheckins = "SELECT page_id, name, description from place where page_id IN (SELECT page_id FROM #friends_checkins)",
       }
   });

JObject resultCheckinsJson = JObject.Parse(resultCheckins.ToString());
DataTable CheckIn = new DataTable();
CheckIn.Columns.Add(new DataColumn("Friend", typeof(string)));
CheckIn.Columns.Add(new DataColumn("Picture", typeof(string)));
CheckIn.Columns.Add(new DataColumn("Link", typeof(string)));
CheckIn.Columns.Add(new DataColumn("Place", typeof(string)));
CheckIn.Columns.Add(new DataColumn("Coords", typeof(string)));
CheckIn.Columns.Add(new DataColumn("When", typeof(string)));
CheckIn.Columns.Add(new DataColumn("Message", typeof(string)));

int thiscounter = 0;
foreach (var row in resultCheckinsJson["data"].Children())
{
    string placename = resultCheckins.data[1].fql_result_set[thiscounter].name.ToString().Replace("\"", "");
    string NavigateURL = "http://facebook.com/" + resultCheckins.data[1].fql_result_set[thiscounter].page_id.ToString().Replace("\"", "");

    DataRow CheckInRow = CheckIn.NewRow();
    CheckInRow["Friend"] = resultCheckins.data[2].fql_result_set[thiscounter].name;
    CheckInRow["Picture"] = resultCheckins.data[2].fql_result_set[thiscounter].pic_small;
    CheckInRow["Link"] = ResolveUrl(NavigateURL);
    CheckInRow["Place"] = resultCheckins.data[1].fql_result_set[thiscounter].name.ToString().Replace("\"", "");
    CheckInRow["Coords"] = resultCheckins.data[0].fql_result_set[thiscounter].coords.ToString().Replace("\"", "");
    DateTime dtDateTime =  dtDateTime.AddSeconds(resultCheckins.data[0].fql_result_set[thiscounter].timestamp).ToLocalTime();
    CheckInRow["When"] = dtDateTime.ToString();
    CheckInRow["Message"] = resultCheckins.data[0].fql_result_set[thiscounter].message.ToString();
    CheckIn.Rows.Add(CheckInRow);
    thiscounter++;
}

尝试更改此行:

foreach (var row in resultCheckinsJson["data"].Children())
致:

foreach(resultCheckinsJson.data中的动态行)

然后获得如下属性:

row.name

我从未使用过Facebook API,但下面问题中的那个家伙用另一种逻辑得出了结果(我也帮他给出了答案)。请检查一下:你可以发布你要返回的JSon(个人信息模糊,或者课程:-)吗。将有助于回答这个问题。。。