?
Solved

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

Posted on 2013-10-26
8
Medium Priority
?
893 Views
Last Modified: 2013-11-01
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

0
Comment
Question by:homeshopper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39602711
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?
0
 

Author Comment

by:homeshopper
ID: 39602742
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.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39602759
If you use integrated security (Integrated Security=SSPI) do you get a connection?
Is the adomd.net framework installed on the server?
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:homeshopper
ID: 39602849
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.
0
 

Author Comment

by:homeshopper
ID: 39602920
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

0
 

Author Comment

by:homeshopper
ID: 39603931
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

0
 
LVL 58

Expert Comment

by:Gary
ID: 39603940
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.
0
 

Author Comment

by:homeshopper
ID: 39603968
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.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question