1

I have the following code that I am trying to get working:-

using (AdomdConnection conn = new AdomdConnection(_connString))
{
    conn.Open();

    Console.WriteLine(conn.ConnectionString);
    Console.WriteLine(conn.Cubes.Count);
}

The following error is thrown with and without the conn.Open() line:-

A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running.

I don't have a SQL Browser service available on the client machine I'm using. But what's vexing me is this exact same connection string works from Excel and pulls back a set of OLAP Cube measures which I can pivot as required.

The connection string is as follows:-

Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=RaptorMarketRiskSummary;Data Source=ssasp-raptor\plnqic01_as;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error

Does anyone have any ideas?

Many thanks.

2
  • Please have a look here Commented Oct 25, 2016 at 9:46
  • @lokusking - thanks for this. However I'm trying to work out why the connection string works from an Excel OLAP pivot connection, but not from AdomdConnection in .Net. The SQL Browser service mentioned is something that can run on the server. It seems to me that if I can connect from Excel (and not require the SQL Browser), I should be able to do the same in .Net. Commented Oct 25, 2016 at 13:24

2 Answers 2

1
+50

Did you try this?

This error seems to related only to named instances. The reason is SQL client is not able to resolve instance because SQL client has no access SQL Browser Service. SQL Browser Service resolves instance name

1.Ensure SQL browser service is running

2.Ensure the port on which SQL browser service runs, is not blocked from PC (default port 2382)

Alternatively, you can bypass SQL Browser Service, by mentioning "Server:Port" instead of "Server\instance name", in the client connection properties

This is an old answer from : a connection cannot be made to redirector. Ensure that 'sql browser' service is running

Look a the Alternatively point :)

Sign up to request clarification or add additional context in comments.

2 Comments

many thanks. I have awarded you the bounty as you're the only person who's been kind enough to answer! I am going to answer the question myself in a moment, as the problem in my case is more prosaic, but worth noting down for others.
Thx very much :) I am sorry that did not help you :/
1

It turns out that this error

A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running

can be caused by problems which have nothing to do with whether the SQL Browser is running or not. (This is intuitively the case given that I could connect from Excel.)

At my workplace each employee has a personal space on a network drive. Because I intended my app to be a quick proof-of-concept to demonstrate .Net's ability to connect to OLAP cubes, I used a folder on my personal network drive as a scratch area. I then tried connecting to another database (directly, not through a cube) and discovered I had a permission issue. I compiled the binary (from Visual Studio) and placed it on another network drive so that a colleague could test from his machine. In checking the binary would throw an error, I ran it from the second network drive and it connected fine and brought back some data.

Changing the app back to connect to my OLAP cube and moving the Visual Studio solution to my local C: drive has resulted in being able to connect to the cube fine and pull back the data I want!

So: the 'Check SQL Browser service is running' error is a catch-all piece of advice which covers a multitude of sins underneath. Permissions can depend on where the app is running from (i.e. which network drive, not just whether the drive is network or local).

Hope this helps :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.