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 71153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:50:35+00:00 2026-05-10T19:50:35+00:00

I am completely new to LINQ in C#/.NET. I understand that I could use

  • 0

I am completely new to LINQ in C#/.NET. I understand that I could use it to convert a DataSet into an Array/List, am I able to go in the opposite direction?

I’m using NPlot to generate a graph of captured prices, which are stored in a List, where PriceInformation is a class containing two public doubles and a DateTime.

Any suggestions very welcome.

  • 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. 2026-05-10T19:50:36+00:00Added an answer on May 10, 2026 at 7:50 pm

    There’s a method called CopyToDataTable. That method will only help if you already have a IEnumerable(DataRow)

    Here’s how I’d do this:

    //extension method to convert my type to an object array. public static object[] ToObjectArray(this MyClass theSource) {   object[] result = new object[3];   result[0] = theSource.FirstDouble;   result[1] = theSource.SecondDouble;   result[2] = theSource.TheDateTime;    return result; }   //some time later, new up a dataTable, set it's columns, and then...  DataTable myTable = new DataTable()  DataColumn column1 = new DataColumn(); column1.DataType = GetType('System.Double'); column1.ColumnName = 'FirstDouble'; myTable.Add(column1);  DataColumn column2 = new DataColumn(); column2.DataType = GetType('System.Double'); column2.ColumnName = 'SecondDouble'; myTable.Add(column2);  DataColumn column3 = new DataColumn(); column3.DataType = GetType('System.DateTime'); column3.ColumnName = 'TheDateTime'; myTable.Add(column3);  // ... Each Element becomes an array, and then a row MyClassList.ForEach(x => myTable.Rows.Add(x.ToObjectArray()); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Set AllowCustomPaging='true' on the aspx. And when databinding do: mygrid.VirtualItemCount… May 11, 2026 at 11:22 am
  • added an answer BIO drives me up the wall but it allows you… May 11, 2026 at 11:22 am
  • added an answer With SQL Server, you could use CONTEXT_INFO to pass info… May 11, 2026 at 11:22 am

Related Questions

I am completely new to LINQ in C#/.NET. I understand that I could use
I am completely new to ruby and I inherited a ruby system for a
I am completely new to Flex. Can I realistically develop, say, a medium complex
I'm completely new to Flex and am just having a play with a sample
I am new to Ruby on Rails, I have completed the Blog Tutorial .
I am completely stumped as to why this code does not get any SDL
I am completely stumped. I have a program that pulls information stored in a
I am completely perplexed with how my Queue is function. I am attempting (and
I feel like i am completely missing something because I am not able to
Can anybody please explain how this could possibly happen? I am completely aware of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.