I would like to poll the status of my connection. To achieve this aim I have this block of code:
AdomdConnection adomdConnection = new AdomdConnection("MYConnectionSTRING");
adomdConnection.Open();
while (true)
{
Console.WriteLine(adomdConnection.State.ToString()+ " "+DateTime.Now.ToString());
System.Threading.Thread.Sleep(3000);
}
it returns me every 3 second the status of the connection. But after I shut down my service it ruturns me also open
. Can someone explain me why`? and how can I figure out the status of my connection to analysis Service?
UPDATE My actual requirement is: I would like to have an eternally connection to my Analysis service. (To send it every 3 seconds a query). So I need a live connection to Analysis Service. My fair is, that the connection timed out somtime. And If the connection is timed out or other thing is happend that force my connection to close. I would like to establish the connection to my analysis Service again How can I do that?