2012-03-02 43 views
2

我有以下FQL查詢:FQL multiquery在圖探險家,但不是在C#.NET執行

https://graph.facebook.com/fql?q={"query1":"SELECT uid2 FROM friend WHERE uid1=me()","query2":"SELECT uid , name , pic_square , affiliations , birthday_date , sex , relationship_status , hometown_location , current_location , education_history , work_history , contact_email FROM user WHERE (sex='male') AND uid IN (SELECT uid2 FROM #query1)"} 

這個工作在圖形資源管理器正常,但是它並沒有在C#中工作;我得到一個HTTP錯誤請求錯誤

我的查詢如下:

"fql?q={'query1':'SELECT+uid2+FROM+friend+WHERE+uid1=me()','query2':'SELECT+uid,name,pic_square,affiliations,birthday_date,sex,relationship_status,hometown_location,current_location,education_history,work_history,contact_email+FROM+user+WHERE+(sex='male')+AND+uid+IN+(SELECT+uid2+FROM+#query1)'}"; 

請幫助。

回答

2
var fb = new Facebook.FacebookClient(token); 
dynamic result = fb.Query(
    "SELECT uid2 FROM friend WHERE uid1=me()", 
    "SELECT uid, name, pic_square, affiliations, birthday_date, sex, relationship_status, hometown_location, current_location, education_history, work_history, contact_email" + 
    " FROM user WHERE (sex='male') AND uid IN (SELECT uid2 FROM #query0)" 
); 

的命名約定開始與指數0,而不是指數1爲其他語言。上面的代碼工作,我用C#運行它,結果是好的。

+0

你輸入了什麼名稱空間。它不檢測我的情況下的FacebookClient – vini 2012-03-06 01:33:00

+0

我使用v 5.4的SDK。它應該適用於最新版本的6.0。 – DMCS 2012-03-06 01:41:53

+0

你正在運行什麼版本? – DMCS 2012-03-06 01:50:46