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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:08:34+00:00 2026-06-06T21:08:34+00:00

There is a typed DataSet Named DsPerson And a custom Typed Generic List Named

  • 0

There is a typed DataSet Named DsPerson
And a custom Typed Generic List Named ListPerson

DsPerson Ds1Person;

List<Person> ListPerson;

Want to do something similar to the code below,

please help me correcting this :

 DataTable dtPerson = Ds1Person.Tables["Person"];
 DataRow drPerson = dtPerson.NewRow();

 DsPerson.PersonRow[] updRows = ListPerson.Cast<Person>().Select(row => dtPerson.NewRow()
                      {
                          Nick = row.Nick,
                          Name = row.NameX,
                       }).ToArray();

Needed a DataRow Array or a general DataTable made this way.

Not looking for Entities here or any other alternatives because of the code specifications I’m working on.

Any help is really appreciated …


More Clarifying :

What Is needed :

Something Like reversing these :
(Opposite way)

http://www.stackoverflow.com/questions/441023/fastest-way-to-convert-datatable-to-generic-list

or a cleaner and Linqy way of doing something similar to this :

http://beecy.net/post/2009/05/18/convert-generic-list-to-datatable-using-reflection.aspx

Get the proper DsPerson.PersonRow[] updRows
to use with
adapter.Update(updRows);

What Is wrong ?

The Cast – Select Statement have slight errors :
I just knew it should be similar to this, so I’m not sure on the structure of this line of code,

for now the reported error is :

Error 2 Cannot implicitly convert type ‘System.Collections.Generic.IEnumerable’ to ‘DsPerson.PersonRow[]’. An explicit conversion exists (are you missing a cast?)

  • 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-06-06T21:08:36+00:00Added an answer on June 6, 2026 at 9:08 pm

    The same should work for a strong typed DataSet:

    DataRow[] updRows = 
        ListPerson.Select(p => dtPerson.Rows.Add(p.Nick, p.Name)).ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a method to return an XML Serialized Typed object. Is there an
There is a ParsedTemplate class that it has over 300 property (typed Details and
I am wondering if there are any statically typed, embeddable scripting languages. Python, JavaScript,
All of the pure functional languages are strong typed. Is there any link between
If I am using a ViewBag which contains a strongly typed object, is there
I have a typed dataset with 2 datatables, TableX and TableY. Created in designer.
So I have a typed dataset that I have created records for from another
my question is very simple. here is my scenario: i have 1 result dataset[named=resultDS
I have a dataset in Reporting Services that looks something like this: ID |
I have a basic dataset stored in javascript that I want to filter based

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.