Occurs when the session between the server that has the running instance of Analysis Services and the client starts to close, but before the session is finally closed.
Assembly: msmgdsrv (in msmgdsrv.dll)
The following code is part of the Analysis Services Personalization Extensions (ASPE) and shows how to use the and SessionOpened events.
The following sample code can also be downloaded from the Microsoft SQL Server Samples and Community Projects Web site. For more information about how to download and install samples, see Installing SQL Server Samples and Sample Databases in SQL Server Books Online.
public class ASClientExtensions
Context.Server.SessionOpened += new EventHandler(this.SessionOpened);
Context.Server.SessionClosing += new EventHandler(this.SessionClosing);
//Verify and set environment for ClientExtensions.
AuthoringAndManagement environment = new AuthoringAndManagement();
public void SessionOpened(object sender, EventArgs e)
// This will subscribe to the events.
SessionMgr session = new SessionMgr();
public void SessionClosing(object sender, EventArgs e)