How to use FQL-Queries

Jul 15, 2008 at 2:44 PM
Hello,

I've downloaded the newest release of the Facebook Developer Toolkit and tried to write my first desktop application.
Unfortunately, the most examples I've tried are written for old assembly releases.

I want to get all online friends. I guess, the most common way to do this is using fql, isn't it?
But I get always an System.StackOverflowException. What I did false?
I'm not sure whats the name of the method and the key name of the key-value-pair.

        private static void ShowOnlineFriends()
{
string apiKey = "<mykey>";
string secret = "<mysecret>";

FacebookAPI fapi = new FacebookAPI();
fapi.ApplicationKey = apiKey;
fapi.Secret = secret;
fapi.IsDesktopApplication = true;

fapi.ConnectToFacebook();

XmlDocument xDoc = fapi.ExecuteApiCall("Fql.query", true, new KeyValuePair<string, string="">("query",
String.Format(CultureInfo.InvariantCulture, "{0}{1}{2}",
"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=", fapi.UserId, ") AND 'active' IN online_presence")));
}
</string,>

Thank you very much in advance.
Best regards
Danny Meier
Jul 24, 2008 at 7:46 PM
Edited Jul 25, 2008 at 12:31 AM
This works for me

fqlResult = _fbService.DirectFQLQuery("SELECT ...");
XmlDocument fqlxmldoc = new XmlDocument();
fqlxmldoc.LoadXml(fqlResult);

My issue is that i'm selecting start_time from the events database, which gives me a double value..  It represents the amount of seconds since Jan 1 1970 GMT, yet I can't seem to get it to convert properly.  Nobody on the facebook discussion areas seems to know what its about, and it seems like this microsoftfacebook solution is completely unsupported.  I tried the getEvents function instead,wtf is with this DateTime? argument?  what do you mean DateTime? <- with a question mark, like whoever wrote and managed to compile this dll wasn't sure.

I think the only solution is to forget microsoft and go to PHP..  at least they have people who care enough to respond on the discussion boards.