Selecting nodes with no namespace using XPath in C#

When nodes in an XML document has no prefix at all you would think that they are associated with the default namespace, but apparently this is not the case.

Those nodes are considered not associated with any namespace at all. So to select them using XPath, in the NamespaceManager first add the default namespace with any arbitrary prefix of your choosing but not string.Empty, for example:

namespaceManager.AddNameSpace(“x”, “http://…”);

Here x is just a randomly chosen prefix

Then, you can use XPath to select nodes using the prefix you just added

doc.SelectNodes(“//x:NodeName”, namespaceManager);

I spent 2 hours to figure this out, talk about wasting time.

Consume Web API response in SSRS

Follow the article: http://jaliyaudagedara.blogspot.sg/2015/10/using-aspnet-web-api-as-data-source-for.html

Need to configure the web api service to always return XML data. When configuring the data source, add ?type=xml at the end of the URL.

Note: for SSRS/Report Builder to retrieve the fields, don’t use blank query string, use the following:

<Query>

</Query>

Find /bin folder for SSRS integrated with SharePoint

SharePoint strikes again.

Follow the article http://blogs.catapultsystems.com/aroney/archive/2013/02/11/custom-dlls-with-sql-server-reporting-services-in-sharepoint-integrated-mode/

Normally, you can find the SSRS at C:\Program Files\Microsoft SQL Server\ MSRS10_50.SQLSERVER\Reporting Services\

If you want to find the folder for SSRS integrated with SharePoint, it’s not where it’s usually located but under the /15 hive, C:\Program Files\Common Files\Microsoft Shared\Web Service Extensions\15\Webservices\reporting\bin