Solved

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

Posted on 2013-10-26
8
842 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
  • 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 500 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
 

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

861 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now