<?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 Re: I am trying to access SAS dataset in C# and keep getting a error. in Developers</title>
    <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835891#M6162</link>
    <description>&lt;P&gt;You could try something like this.&lt;/P&gt;
&lt;PRE&gt;cmd.Connection = conn;
cmd.CommandText = "libname survlib '" + pSASSurveyFolder + "';";
cmd.ExecuteNonQuery();
cmd.CommandType = CommandType.TableDirect;
cmd.CommandText = "survlib.vstatps";
OleDbDataReader myReader = cmd.ExecuteReader();&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Sep 2022 16:56:50 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2022-09-29T16:56:50Z</dc:date>
    <item>
      <title>I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835853#M6153</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A server error has occurred: ERROR: Unexpected ERROR from SHRWTSK5 detected by TERMINATE WORK TASK in "ERREB"(0): ERROR: Generic critical error.; fn =yhelasg; context =sase9lib.dll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using (OleDbConnection conn = new OleDbConnection(GlobalConfig.SASConn()))&lt;BR /&gt;{&lt;BR /&gt;conn.Open();&lt;/P&gt;&lt;P&gt;OleDbCommand cmd = conn.CreateCommand();&lt;BR /&gt;cmd.CommandType = CommandType.Text;&lt;BR /&gt;cmd.CommandText = "libname survlib '" + pSASSurveyFolder3 + "'";&lt;/P&gt;&lt;P&gt;cmd.ExecuteNonQuery();&lt;/P&gt;&lt;P&gt;cmd.CommandType = CommandType.TableDirect;&lt;BR /&gt;cmd.CommandText = "vstatps";&lt;/P&gt;&lt;P&gt;//other option is to use the cmd.ExecuteReader();&lt;BR /&gt;OleDbDataAdapter da = new OleDbDataAdapter(cmd);&lt;BR /&gt;da.Fill(sasDs);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835853#M6153</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835856#M6154</link>
      <description>&lt;P&gt;For a test, try the project I've &lt;A href="https://github.com/cjdinger/SasHarness" target="_self"&gt;shared here to connect a .NET application to a SAS Workspace and data&lt;/A&gt;. There are some tricks, including the ObjectKeeper mechanism to reference the SAS connection during your session.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835856#M6154</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-29T14:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835860#M6155</link>
      <description>&lt;P&gt;Thanks Chris..Will check it out.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835860#M6155</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T14:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835863#M6156</link>
      <description>&lt;P&gt;Chris, I checked out your project and your connection string looks different than mine. Mine looks like this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;return @"Provider = sas.shareprovider.1; data source = xxxx; location = xxxx; SAS Server Access Password =xxxx";&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835863#M6156</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T14:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835867#M6157</link>
      <description>&lt;P&gt;It looks like you are trying to connect to a SAS/SHARE server. Is that correct? You aren't connecting to a SAS Workspace via SAS Integration Technologies?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basic example for SAS/SHARE (and I mean really basic) &lt;A href="https://support.sas.com/documentation/tools/oledb/dbs011.htm" target="_self"&gt;is in this doc&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We also have &lt;A href="https://go.documentation.sas.com/doc/en/odbcdref/9.4/p0cpyxc20b5ybin1o5sretxxv6au.htm" target="_self"&gt;an ODBC driver for SAS/SHARE&lt;/A&gt;, might be worth testing if that's your case.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 15:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835867#M6157</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-29T15:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835876#M6158</link>
      <description>&lt;P&gt;Yes, you are correct. The&amp;nbsp;&lt;SPAN&gt;Basic example for SAS/SHARE&amp;nbsp;you linked is exactly what my connection string looks like. My issue is what to do next. Using the connection, I connect to the libraries like this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cmd.Connection = conn;&lt;BR /&gt;cmd.CommandText = "libname survlib '" + pSASSurveyFolder + "'";&lt;BR /&gt;cmd.ExecuteNonQuery();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At this point, no errors. It's when I try to retrieve data from the datasets using a sql statement that I get an error. It's here that I need some guidance. Thanks for the help!!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 15:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835876#M6158</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835885#M6159</link>
      <description>&lt;P&gt;I think your CommandText should be an SQL command. Ex:&lt;/P&gt;
&lt;PRE&gt;select * from SURVLIB.VSTATPS&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835885#M6159</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-29T16:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835888#M6160</link>
      <description>&lt;P&gt;Ok. I just tried that and now it says that "SURVLIB" is not assigned. Don't we define the library first and then execute sql?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835888#M6160</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T16:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835890#M6161</link>
      <description>&lt;P&gt;Usually with SAS/SHARE the library is already defined. That's the point of SAS/SHARE -- to enable other applications to connect to curated data sources that are maintained in a SAS environment, served up by a SAS/SHARE server. It's not a place to run SAS code (like a LIBNAME statement) -- that's a SAS Workspace.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835890#M6161</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-29T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835891#M6162</link>
      <description>&lt;P&gt;You could try something like this.&lt;/P&gt;
&lt;PRE&gt;cmd.Connection = conn;
cmd.CommandText = "libname survlib '" + pSASSurveyFolder + "';";
cmd.ExecuteNonQuery();
cmd.CommandType = CommandType.TableDirect;
cmd.CommandText = "survlib.vstatps";
OleDbDataReader myReader = cmd.ExecuteReader();&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835891#M6162</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-29T16:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835905#M6163</link>
      <description>&lt;P&gt;Thanks Chris. Will try it...&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835905#M6163</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T18:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835911#M6164</link>
      <description>&lt;P&gt;Everything works fine until I try to execute the reader and I get this:&lt;/P&gt;&lt;P&gt;Error A server error has occurred: ERROR: Unexpected ERROR from SHRWTSK8 detected by TERMINATE WORK TASK in "ERREB"(0): ERROR:&lt;/P&gt;&lt;P&gt;Generic critical error.; fn =yhelasg; context =sase9lib.dll.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/835911#M6164</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-09-29T18:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/836052#M6165</link>
      <description>&lt;P&gt;I searched internal information here and found a documented problem that has been addressed in a SAS/SHARE hotfix:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/62/346.html" target="_blank"&gt;https://support.sas.com/kb/62/346.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know if you have any control/influence on this SAS/SHARE server to request that all hotfixes get applied. If not, I'm not sure how to address. You might try using the SAS/SHARE ODBC driver instead, which might follow a different code path.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 12:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/836052#M6165</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-09-30T12:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to access SAS dataset in C# and keep getting a error.</title>
      <link>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/836505#M6169</link>
      <description>&lt;P&gt;Thanks Chris..Will read the article and see what can be done.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 12:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/I-am-trying-to-access-SAS-dataset-in-C-and-keep-getting-a-error/m-p/836505#M6169</guid>
      <dc:creator>muungo60</dc:creator>
      <dc:date>2022-10-03T12:45:45Z</dc:date>
    </item>
  </channel>
</rss>

