Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:36:09+00:00 2026-05-24T06:36:09+00:00

I have C# .NET code with a DataSet (System.Data.DataSet) containing one table of data,

  • 0

I have C# .NET code with a DataSet (System.Data.DataSet) containing one table of data, and I’m trying to create a new SAS data table on a SAS server and then push the data into it using C#.

Right now, I can create the new table on the SAS server, but I’m not sure how to transfer the data. I tried using this insert command (exportData is the DataSet):

"INSERT INTO SASUSER." + SAStableName + " SELECT * FROM " + exportData.Tables[0].TableName

But it thinks that the exportData table name is supposed to be a SAS library name. All I get when searching the web is examples that only take data out of SAS, which is easy with a TableDirect command type and the OLEDB fill method. It seems to be not so easy to reverse the process.

Note: I’m using the sas.IOMProvider provider in my connectionstring.

Thanks

EDIT: After all the searching I’ve been doing, I assume you can’t really do this. I tried using SQL parameterization, but the SAS provider doesn’t support that. I finally decided to use a simple for loop to add the values since all my source and target tables contain the same columns. Semi-pseudo code:

DateTime time = (System.DateTime)exportTable.Rows[i]["time"];
object value = exportTable.Rows[i]["value"];
"INSERT INTO SASUSER." + tableName + " (time, value) VALUES (" + time.Ticks + " , " + value + ")"

I’m still having trouble with loading dates into a new SAS table using an SQL INSERT clause (see code above). Not sure how they’re supposed to be formatted. The time values in the source table (exportTable) are DateTime objects, so the cast is valid.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:36:09+00:00Added an answer on May 24, 2026 at 6:36 am

    Instead of trying to do it as an INSERT from the dataset, can you approach it from the opposite direction do it as an EXPORT to to the table (SASUSER.tablename)?

    http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003102702.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some .NET remoting code where a factory method, implemented in some server
I have the following VB.NET code that I am using to sort a Data.DataTable
I have a vb.net function which uses oledb to create a spreadsheet, then treat
I have the ability to query a legacy system that returns a .NET DataSet.
I have ASP.Net code similar to the following (this is inside a FIELDSET): <ol>
I have some C# / asp.net code I inherited which has a textbox which
I have a line of C# in my ASP.NET code behind that looks like
How can I modify the PDF document properties programmatically using .NET code? I have
I currently have CruiseControl.NET set up with SVN to automatically grab the code source
I'm using an Ajax update panel and have recently added ASP.NET tracing code to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.