private void OnOpenData_Click(object sender, EventArgs e) { if (activeSession != null && activeSession.IsConnected) { DataViewerForm dlg = new DataViewerForm(activeSession); dlg.Show(this); } else { MessageBox.Show("You must connect to a SAS session before you can open data.", "Connect to SAS"); } }