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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:31:22+00:00 2026-05-15T08:31:22+00:00

hanks everybody to help my idiot problem (look my before post:) ) . But

  • 0

hanks everybody to help my idiot problem (look my before post:) ) . But i exactly need below. I should fill 1 dimentional array from legth of per cell Datatable. and sort 1D array linq and also without linq

 int[][] lengths;

            using (DataTable table = GetTable())
            {
                lengths = (from DataRow row in table.Rows
                           select
                           (from DataColumn col in table.Columns
                            select row[col].ToString().Length).ToArray()).ToArray();
            }

            int[] Sortedlist;
            foreach (int[] row in lengths)
            {
                Sortedlist = row; ---- I NEED HELP !!!!
            }

            foreach (int item in Sortedlist)
            {
                item.Sort(); ----- I NEED HELP!!!
            }

My Data:

static DataTable GetTable() { // // Here we create a DataTable with four columns. // DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Patient", typeof(string)); table.Columns.Add("Date", typeof(DateTime)); // // Here we add five DataRows. // table.Rows.Add(25, "Indocin", "David", DateTime.Now); table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now); table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now); table.Rows.Add(21, "Combivent", "Janet", DateTime.Now); table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now); return table; }
  • 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-15T08:31:22+00:00Added an answer on May 15, 2026 at 8:31 am

    Not sure what you mean . You have an int[][] datastructure(from the main linq query).
    Your req is to convert it into a int[] structure and then sort it using linq and also sort it using Array.sort.
    This should do it

       int[] UnSortedlist = lengths.SelectMany(x => x).ToArray();
                int[] sortedListLinq = UnSortedlist.OrderBy(x => x).ToArray();
                Array.Sort(UnSortedlist);
                int[] sortedListnonLinq = UnSortedlist;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It should be hands-on, complete, targeted to programmers and detailed on layout techniques!
My application hangs. Pressing the home button doesn't return to the springboard anymore. Additionally
If you had a 10 minute hands-on session to teach someone Emacs, what would
I am currently doing IE-hacks on a website I'm working on: http://www.timkjaerlange.com/wip/co2penhagen/ I got
I have a mystery on my hands. I am trying to learn managed C++
I've been getting my hands dirty lately working on development for the iPhone. Development
So I'm trying my hands at a css menu and I have a simple
Occasionally a program on a Windows machine goes crazy and just hangs. So I'll
Have you guys and gals got any tips or hacks for making the most
I have a bit of a hybrid situation on my hands. I'm writing an

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.