how to write where condition in fql facebook using asp.net? - asp.net

I need to execute a fql using facebook dll in asp.net.
The fql is ="select name, profile_url from user where name = 'suresh'". When I execute this i could not get the response . I am getting only empty string.
string response = fbService.fql.query("select name, profile_url from user where name = 'suresh'");
but if i search by id i can get response..
so, how to search by name in that..
thanks
r.eswaran.

The name field contains the full name. It can't be a just a partial value. Are you sure that the full value isn't something like 'Suresh Lastname' ?
I recommend you use the Facebook API Test Console to test out the queries. It can be found at:
http://developers.facebook.com/tools.php
Select "fql.query" as the method. It will come up with a field where you can enter your FQL queries to test.

Related

Search query with current username

I need define fts or lucene query with parameter current logged user, for example I need something like this:
ASPECT:'cm:lockable' AND! ASPECT:'cm:workingCopy' AND cm:lockOwner:'getCurrentLoggedUser'
I need this query for dashlet creating by saved search , which will show locked files which are locked by logged user.
Is there a way to get a username of current logged user?
Thanks.
You cannot use an expression like that directly in the query.
It won't be difficult to get the authenticated user first and then build the query with string concatenation.
Your dashlet should have a javascript controller where you can use "root" objects. One of them is person that is the current authenticated user.
https://docs.alfresco.com/content-services/6.1/develop/reference/repo-root-objects-ref/

Get the userid in telegram

I'm using #username_to_id_bot to retrieve the user_id.
Sometimes the user doesn't have a username.
How can I retrive in this case?
For each user response the Telegram payload includes information like user_id and chat_id.
You can always access these navigating the JSON.
When processing a simple text response
update.message.from_user.id
When processing a Callback Query
update.callback_query.from_user.id
If you are using web application, in address bar you can see URL like following:
https://web.telegram.org/#/im?p=u1111111111_2222222222222222222
In this case 1111111111 is the user_id which you are looking for.

How to Query Realm DB Browser?

I need to filter the DB on the basis of Id. On top there is search bar stating "Enter the query to filter the list". How to query to get some specific id filtered in RealmDB browser.
My DB URL: https://i.stack.imgur.com/G1iXY.png
That field is used to enter queries aka Filter. Suppose you have a Dog Class with a dog_name property. To search for a Dog with the name Fido, you would enter this into the field
dog_name == "Fido"
The field is evaluated live so as soon as a valid query is entered, the results are updated.
If you look at the docs (this is Swift) you will see an example like this
// Query using a predicate string
var tanDogs = realm.objects(Dog.self).filter("color = 'tan' AND name BEGINSWITH 'B'")
To apply the same filter, just use the part within the quotes in Realm Studio
color = 'tan' AND name BEGINSWITH 'B'

Classic asp query not sorting by username connecting to a Microsoft Access database

I am running across a strange occurrence using classic asp. I inherited an application which is written in classic asp connecting to a Microsoft Access Database. I am editing the code in Adobe Dreamweaver. In the table I am trying to query, it contains 2 fields: ID and username. The fields on the asp page include month, year, and the username. If I query the ID field, the query displays properly, and the username field is display by ID. However if I try to order the query by username it will not display properly. Instead it doesn't display an username at all.
The classic asp code which works as follows when I want to order by the ID:
rstDATA.open "SELECT username FROM [c-names] order by ID", cnn, adLockReadOnly
The classic asp code which works is as follows when I want to order by the
username which doesn't work:
rstDATA.open "SELECT username FROM [c-names] order by username", cnn, adLockReadOnly
The strange part is if I run a sql query within Microsoft Access it works:
SELECT [c-names].[username] FROM [c-names] ORDER BY [c-names].[username];
I tried to paste the code in the classic asp page but it didn't work either.
Does anyone know why it is not working? Any assistance would be greatly appreciated.
this is not "strange part", that is how it should be.
if you are using reserved word as field name, then you must take field name in brasket '[]'.
https://support.microsoft.com/en-us/kb/826763
WORKAROUND
To work arond this problem, do not use special characters.
If you must use special characters in query expressions, enclose the
special characters in brackets ([]). For example, if you want to use
the greater than sign (>), use [>].

problem in viewing others user profile (asp.net )

i am creating site like say LinkedIn/spoke
like when i login ,i give my login id and password so database
checks it and allow me to access my profile
i need to know that in stackoverflow when we click to users
button all the users in stackoverflow are shown
but when i click to specific user
how does the database known that this specific user is clicked
and show's his/her profile data ?
should i create new page for viewing others user profile ?
and if i do so what will be the query for that
If you have 2 seperate queries then it makes easier (I'm not saying this is the best solution). So, you could have a 'select all users' query which could be something as simple as :
SELECT *
FROM MyUsers
This will return all of your users to your website, so you can view them. Then, when you select a user from your website, you call a different query, say 'select a single user', and pass a parameter from your website. The query could look something like :
SELECT *
FROM MyUsers
WHERE UserID = #UserID
This could be done in one stored procedure and test if your #UserID is NULL then run the required SELECT statement.

Resources