Solved

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

Posted on 2013-10-26
8
837 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Data Saving 5 40
ConsoleSql 1 22
How toselect unique values 3 10
SQL Server 2012 Express to Full 5 26
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

744 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

13 Experts available now in Live!

Get 1:1 Help Now