Cannot get search result from Bing Search API


  • var bingContainer = new Bing.BingSearchContainer(
                  new Uri(""));

                var accountKey = "MY ACCOUNT KEY";

                bingContainer.Credentials = new NetworkCredential(accountKey, accountKey);

                var webQuery = bingContainer.Web("google", null, null, null, null, null, null, null);
                webQuery = webQuery.AddQueryOption("$top", 10);
                var webResults = webQuery.Execute();

    I would like to ask why I cannot get any result using above code in c#. var webResults = webQuery.Execute() always threw exception. And always display base = {"The XmlReader must be on a node of type Element instead of a node of type None."}.

    Can anyone please help me to solve it? I get this problem for 3 days. :(

    Thursday, January 02, 2014 10:24 AM


All replies

  • Hello,

    Thanks for posting!

    According to your error information, I guess your reference ("DataServiceQuery") may have some thing wrong.

    Please check your "System.Data.Services.Client.dll"'s version is above V4 and was added rightly.Also, I suggest you could use the latest SDK and re-add your service DLL file. You could download Bing Search API sample from this page( and try again.

    Please try it.

    Hope it helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 03, 2014 5:51 AM
  • Thanks for you reply. I have fixed the problem. it was due to the reason that I did not read the executed result using foreach or else. :)
    Friday, January 03, 2014 6:16 AM