Showing posts with label amo. Show all posts
Showing posts with label amo. Show all posts

Monday, March 19, 2012

Is this a bug?

i use AMO to connect MSAS2005. Seems everything is fine except i do like this:

I try to restart the Analysis Service, and then connect to the server. This will cause windows prompt msmdsrv.exe error or debug info sometimes. This comes with the Connect() methed, but the codes will continue running - that means the code doesn't throw exceptions and executed as usual. I tried to sleep the thread for a while(Like in code make 10 seconds sleeping) but cann't pass the test for every time. Coding as below:

ControlService("MSSQLServerOLAPService", ServicesAccess.ServiceAction.Restart) //using ServiceController class to restart the windows service
System.Threading.Thread.Sleep(10000); //Even sleep the process for 10 Seconds
Server server = new Server();
server.Connect("localhost");
... ...

bool ControlService(string strServiceName, ServiceAction action)
{
try
{
oService = new ServiceController(strServiceName);

if (action == ServiceAction.Stop || action == ServiceAction.Restart)
{
if (!oService.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Stopped) && oService.CanStop)
{
oService.Stop();
oService.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped);
}
}

if (action == ServiceAction.Start || action == ServiceAction.Restart)
{
if (!oService.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Running))
{
oService.Start();
oService.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running);
}
}
}
catch (Exception e)
{
throw e;
}
return true;
}

Sometimes you need more than 10 sec for Analysis Server to start.

As for the rest. It is hard to say what is going on. If you are able to restart Analysis Server using service control manager (SCM) and then connect to it from your AMO application that would mean your ServiceControl code is not functioning correctly.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

yes, this is the problem i tried to describe.

we don't know if the analysis service is ready to connect even we get its "running" status from the codes. And if we connect it at this time, it will tell us it's crashed.

Wednesday, March 7, 2012

is there any way AMO app can get information from data source without reprompting user for user

I'm writing some code that will use AMO to access an AnalysisServices cube. I've found that some information that I need doesn't appear to be available from the AMO interfaces directly, so I need to get the information from one of the data sources. I tried using ADO.NET to connect to the data source, but I found that the Microsoft.AnalysisServices.DataSource.ConnectionString has the authentication information (i.e. username and password) removed. So... is there any other alternative that will allow me to get information from the data source (i.e. issue SQL command to the data source and retrieve the result), that does not require me to prompt the user for the authentication information? Can I somehow go through the AMO and have it issue the command and get the result? I'm new to this and hoping that someone can provide a suggestion.

Thanks in advance!

Arden

I don't think there is anyway of doing this.

Have you had a look at some of the schema rowsets that are available? If you are after lists of members or something like that there may be another way of achieving what you are after. Someone might be able to help if you could explain what information you are after.

is there any way AMO app can get information from data source without reprompting user for u

I'm writing some code that will use AMO to access an AnalysisServices cube. I've found that some information that I need doesn't appear to be available from the AMO interfaces directly, so I need to get the information from one of the data sources. I tried using ADO.NET to connect to the data source, but I found that the Microsoft.AnalysisServices.DataSource.ConnectionString has the authentication information (i.e. username and password) removed. So... is there any other alternative that will allow me to get information from the data source (i.e. issue SQL command to the data source and retrieve the result), that does not require me to prompt the user for the authentication information? Can I somehow go through the AMO and have it issue the command and get the result? I'm new to this and hoping that someone can provide a suggestion.

Thanks in advance!

Arden

I don't think there is anyway of doing this.

Have you had a look at some of the schema rowsets that are available? If you are after lists of members or something like that there may be another way of achieving what you are after. Someone might be able to help if you could explain what information you are after.