Link to home
Start Free TrialLog in
Avatar of homeshopper
homeshopperFlag for United Kingdom of Great Britain and Northern Ireland

asked on

System.Data.OleDb.OleDbException: OLAP Provider Connection refused

I am getting following error: System.Data.OleDb.OleDbException: OLAP Provider Connection refused
Below is the complete error and my code for clarity:
Thanks in advance for any help given.
public void BindData9()
    {
    try
		{
		string server_tb = (string)Session["Server"];string user_tb = (string)Session["UserName"];string pswrd_tb = (string)Session["Password"];string database_tb = (string)Session["DatabaseSelected"];string table_tb = (string)Session["TableSelected"];
		string connectionString = System.Convert.ToString(Session["strConnection"]);
		lblTable.Text = "<font color='Silver'>" + "Ln:152T:BD9:" + connectionString + "#" + "</font>" + "<font color='green'>" + "&nbsp;&nbsp;&nbsp;&nbsp;tbl:" + "</font>" + "<font color='Silver'>" + table_tb + "#" + "</font>";
		errorLabel4.Text = "<font color='red'>" + "err:153T:BD9:" + "</font>" + "ex.ToString()";	
		string MyDatabase = database_tb;
		string dbCat = "Initial Catalog=" + MyDatabase + ";";
		string myConnectionString = "Provider=MSOLAP;Data source=Dinosaur1;User ID=sa;Password=H6web97!;Initial Catalog=" + database_tb + ";";
		lblTable.Text = "<font color='Silver'>" + "Ln:157T:BD9:" + myConnectionString + "#" + "</font>" + "<font color='green'>" + "&nbsp;&nbsp;&nbsp;&nbsp;tbl:" + "</font>" + "<font color='Silver'>" + table_tb + "#" + "</font>";
		OleDbConnection connection = new OleDbConnection(myConnectionString); 
		connection.Open();// Line 159 Error Here
		Guid contentSchema = new  Guid("{3add8a76-d8b9-11d2-8d2a-00e029154fde}");
		DataTable dt = connection.GetOleDbSchemaTable(contentSchema,new
		object[] {"MyDatabase", null, "MemberCard_Prediction"});;
		}
		catch (Exception ex)
        {
            errorLabel4.Text = "<font color='red'>" + "err:166E:BD9:" + "</font>" + ex.ToString();
        } // End catch
	}// End BindData9

Open in new window

errorLabel4:err:166E:BD9:System.Data.OleDb.OleDbException: The following system error occurred: 
No connection could be made because the target machine actively refused it. . 
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) 
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, 
DbConnectionPool pool, DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup 
poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) 
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) 
at System.Data.OleDb.OleDbConnection.Open() 
at aaaMisc0.BindData9() line 159

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

The error is telling you what is wrong.  The machine your db is hosted on is refusing the connection - either it is not running, not listening on the port, firewall blocking the connection etc.
It is not a problem with your code.

Can you ping the machines IP?
Avatar of homeshopper

ASKER

Thank you for the suggestion.
I have the following running:
Sql server 2008, Analysis Services, Reporting Services,Server Agent.
If I use Provider=Sqloledb I get a connection.
When using Provider=msolap I get the error.
Thanks in advance for any help.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
When using Integrated Security=SSPI   I get same error.
I thought I had the framework installed.
I am just downloading adomd.net and installing.
I'll let you know later, how I get on.
adomd.net installed, get new error now:
errorLabel4:err:166E:BD9:System.Data.OleDb.OleDbException: An error was encountered in the transport layer. 
The peer prematurely closed the connection. at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, 
OleDbConnection connection) 
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, 
Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup 
poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) 
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) 
at System.Data.OleDb.OleDbConnection.Open() 
at aaaMisc0.BindData9() in line 159

Open in new window

I have re-pointed the Virtual Directory in IIS to the project path.
Also, have new connection detail as follows:
string myConnectionString = "Provider=MSOLAP;Data Source=Dinosaur1;Integrated Security=SSPI;Initial Catalog=" + database_tb + ";";
Not sure, what to try next, get new error as below:
Thanks in advance for any help.
errorLabel4:err:166E:BD9:System.Data.OleDb.OleDbException: Either the user, DINOSAUR1\Ian, does not have access to the 
AdventureWorksDW2008 database, or the database does not exist. 
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) 
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, 
DbConnectionPool pool, DbConnection owningObject) 
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup 
poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) 
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) 
at System.Data.OleDb.OleDbConnection.Open() at aaaMisc0.BindData9() 

Open in new window

Does DINOSAUR1\Ian have permissions to access the analysis service?
Going to add MSSQL to your topics and send out an alert, this is a bit out of my comfort zone.
Thanks, I think you are right about permissions etc.
I have been playing around with IIS in computer management.
also msmdpump.dll
It is a bit of a mine field and am pulling out my hair at the moment.