Solved

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

Posted on 2013-10-26
8
853 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

810 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