I wrote an C# Application to access an AS Server to get Data and to generate Excel Reports (AdHoc Reports). I have used the the Microsoft.AnalysisServices, Microsoft.AnalysisServices.AdomdClient and the Microsoft.AnalysisServices.AdomdClient DLL's.
I was able to connet to the SQL Server 2005 Analysis Services without troubles. After the installation of SQL Server 2008 i'm not able anymore to get the access/connection to the SSAS Database. (I have also replaced all .DLL from SQL Server 2005 to SQL Server 2008 Version)
I use windows 7. My Image (windows server 2008 with sql server 2008 is running as an image on windows server 2008 with hyper v).
public void connectToSSASServer(string providerName, string dbServerName, string username, string password) { try { mServer = new Server(); mstrServerName = dbServerName; mstrUsername = username; mstrPassword = password; // providerName = MSOLAP.3 mstrConnectionDB = "Provider=" + providerName + ";" + " Data Source=" + dbServerName + ";" + "uid=" + username + ";" + "pwd=" + password + ";"; mServer.Connect(mstrConnectionDB); } catch (Exception ex) { throw new Exception(ex.ToString()); }
Since i use Windows Server 2008 and SQL Server 2008 i get fologing exception:
Microsoft.AnalysisServices.ConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at Microsoft.AnalysisServices.DimeRecord.ForceRead(Stream stream, Byte[] buffer, Int32 length)
at Microsoft.AnalysisServices.DimeRecord.ReadHeader()
at Microsoft.AnalysisServices.DimeRecord..ctor(Stream stream)
at Microsoft.AnalysisServices.DimeReader.ReadRecord()
at Microsoft.AnalysisServices.TcpStream.GetResponseDataType()
--- End of inner exception stack trace ---
at Microsoft.AnalysisServices.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)
at Microsoft.AnalysisServices.XmlaClient.Connect(String connectionString, Boolean beginSession)
at Microsoft.AnalysisServices.Server.Connect(String connectionString, String sessionId)
at Microsoft.AnalysisServices.Server.Connect(String connectionString)
at ABCExcelAddIn.CCube.connectToSSASServer(String providerName, String dbServerName, String username, String password)
I have also enabled the following Ports, 1433 and 2383 on Windows Server 2008 firewall. My Server is accesible from other Windows clients via Management Studio. I'm able to browse the DB and also the SSAS DB with Management Studio. I'm also able to access the Cube via Excel.
I' am also able to connect (with my program) from one hypver v image to my windows server 2008 + sql server 2008, but i'am not able to connect from my local windows 7 to my windows server 2008+sql server 2008 image. I'm only able to connect from a Laptop (Win XP) with the administrator account but not with a normal user. Is it posible that i have to implement some special seciurity privilegs in my programm? What is necassary to implement that i will be able to access the Analysis Server
I don't have any ideas. I would be very happy i someone could help me.
Thx for any help!