First, thank you for your reply. I use 1 or more background SAS session before I want to run two or more job asychronously, for example, a ETL job and Forecast job at the same time. I have found the reason: the DoWork method is in the background session, and the RunWorkerCompleted in the foreground session, so if I create obSAS2, get OleDbconnection2, run sas codes only in the same sesion, that's will be OK. I have tested it in my EG Add-in for several days, there is no problem, at last until today. Although SAS open a door to enhance EG by development of Add-in, there are still too few materials about the development, so another question. SAS.Tasks.Toolkit.SasServer obServer; try { obServer = new SAS.Tasks.Toolkit.SasServer( consumer.AssignedServer); }...... How to get SAS workspace from the obServer, I know I can get SAS workspace from "consumer", but if connection between server and EG is broken, I must re-connect manually by hands, now I try to do it by codes. I find the method SAS.Tasks.Toolkit.SasServer.GetWorkspaceIdentifier() Remarks This method will force a connection to the SAS server, if the connection does not yet exist. The connection might cause a slight delay. It might also force a prompt for user ID and password, depending upon the configuration of the server and its metadata.
... View more