<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic EG Add-in Development problem --  Colocated workspace in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19579#M3324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're correct.&amp;nbsp; The API doesn't connect all of the dots in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the WorkspaceIdentifier, which exists only if you are already connected to a session.&amp;nbsp; That will give you the workspace ID for the session that EG knows about (not any second session you might have spawned using code from your previous post).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you cannot get the IWorkspace handle from the SasServer class.&amp;nbsp; Given the workspace ID, you can probably find it using the ObjectKeeper route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the IWorkspace from the ISASTaskConsumer, given the server name.&amp;nbsp; But that will throw the logic back into EG to connect to a server as well, if you haven't already got a connection.&amp;nbsp; Again, it's the one-and-only SAS workspace connection (per logical server) that EG will manage for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 17:08:00 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2012-03-16T17:08:00Z</dc:date>
    <item>
      <title>EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19574#M3319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;obSAS2 = obSAS.GetNewWorkspace();&lt;/P&gt;&lt;P&gt;sasDbConn2 = new OleDbConnection();&lt;/P&gt;&lt;P&gt;sasDbConn2.ConnectionString = "provider=sas.iomprovider.1; SAS Workspace ID=" + obSAS2.UniqueIdentifier;&lt;/P&gt;&lt;P&gt;sasDbConn2.Open();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll create colocated workspaces for parallel processing, but when compiling codes and reaching the line to open an OleDbConnection, visual studio throws an exception showing:&lt;/P&gt;&lt;P&gt;The object 2C2A3465-99AF-4C56-8653-B5D5CCED59BF could not be found; make sure it was previously added to the object keeper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone once meet the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 02:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19574#M3319</guid>
      <dc:creator>qkaiwei</dc:creator>
      <dc:date>2012-03-02T02:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19575#M3320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to register your SAS workspace to the so called "object keeper" first.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You find an example here: &lt;/SPAN&gt;&lt;SPAN class="jive-link-external-small"&gt;&lt;A href="http://savian.blogspot.com/2011/04/this-one-is-real-keeper.html"&gt;http://savian.blogspot.com/2011/04/this-one-is-real-keeper.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 09:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19575#M3320</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2012-03-02T09:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19576#M3321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you, your post is very helpful. but there is another question. &lt;/P&gt;&lt;P&gt;You kwow, the purpose I create obSAS2 is to perform background processing and the user need not to face frozen UI and wait for a long time before the result coming out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following codes, expecially the line with comments, &lt;/P&gt;&lt;P&gt;sasDbAdap.Fill(srcTable);&lt;/P&gt;&lt;P&gt;I don't why there is a NullReferenceException thrown, do you have experience of using obSAS with BackgroundWorker? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At last, If try to close obSAS2, is my way OK or not?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obOK.RemoveObject(obSAS2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obSAS2.Close();&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*----------------------------------------------------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;private void bgWorker_DoWork(object sender, DoWorkEventArgs e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgSuccess = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (obSAS2 == null || obSAS2.UniqueIdentifier.Length == 0) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obSAS2 = obSAS.GetNewWorkspace();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SasServerCount++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obOK.AddObject(SasServerCount, SasServerCount+":SASBK", obSAS2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Stored Process Execution*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasDbConn2 = new OleDbConnection();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasDbConn2.ConnectionString = "provider=sas.iomprovider.9.2; SAS Workspace ID=" + obSAS2.UniqueIdentifier;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasDbConn2.Open();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void obSASLang2_StepError() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgSuccess = false;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OleDbDataAdapter sasDbAdap = new OleDbDataAdapter("select * from sashelp.class", sasDbConn);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sasDbAdap.Fill(srcTable);&amp;nbsp; /*Error: NullReferenceException*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception ex) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgSuccess = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (bgSuccess)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.grd.DataSource = srcTable;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Close obSAS2*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obOK.RemoveObject(obSAS2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obSAS2.Close();&amp;nbsp;&amp;nbsp; &lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19576#M3321</guid>
      <dc:creator>qkaiwei</dc:creator>
      <dc:date>2012-03-02T18:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19577#M3322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand why you need a second SAS session just to prevent your UI from freezing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use a backgroundworker (&lt;A href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"&gt;msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx&lt;/A&gt;) with your primary SAS Session to execute your SAS Code and write the results to a dataset in the backgroundworker thread you don't need a second SAS session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 09:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19577#M3322</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2012-03-05T09:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19578#M3323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although SAS open a door to enhance EG by development of Add-in,&amp;nbsp; there are still too few materials about the development, so another question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS.Tasks.Toolkit.SasServer obServer;&lt;BR /&gt;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; obServer = new SAS.Tasks.Toolkit.SasServer( consumer.AssignedServer);&lt;/P&gt;&lt;P&gt;}......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find the method SAS.Tasks.Toolkit.SasServer.GetWorkspaceIdentifier()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remarks&lt;/P&gt;&lt;P class="section" id="remarksSection"&gt;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. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 06:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19578#M3323</guid>
      <dc:creator>qkaiwei</dc:creator>
      <dc:date>2012-03-07T06:51:05Z</dc:date>
    </item>
    <item>
      <title>EG Add-in Development problem --  Colocated workspace</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19579#M3324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're correct.&amp;nbsp; The API doesn't connect all of the dots in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the WorkspaceIdentifier, which exists only if you are already connected to a session.&amp;nbsp; That will give you the workspace ID for the session that EG knows about (not any second session you might have spawned using code from your previous post).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you cannot get the IWorkspace handle from the SasServer class.&amp;nbsp; Given the workspace ID, you can probably find it using the ObjectKeeper route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the IWorkspace from the ISASTaskConsumer, given the server name.&amp;nbsp; But that will throw the logic back into EG to connect to a server as well, if you haven't already got a connection.&amp;nbsp; Again, it's the one-and-only SAS workspace connection (per logical server) that EG will manage for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/EG-Add-in-Development-problem-Colocated-workspace/m-p/19579#M3324</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2012-03-16T17:08:00Z</dc:date>
    </item>
  </channel>
</rss>

