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

  • Home
  • SEARCH
  • 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

I know this is not a coding specific problem but this is the most
I am trying my hands on implementing a batch process. I need some help/guidance
Do I need hands on experience in following before starting EJB 3. RMI Design
On Ruby on Rails, say, if the Actor model object is Tom Hanks, and
I am trying hands on one code in C where in I need to
Hi Everybody, I have a third party library that contains an error. When I
My problem is . I am writing a program to make reservations. For this
I've been working with databases for a long time but I'm new to query
I have had a little experience with CSS but am always befuddled when I
It should be hands-on, complete, targeted to programmers and detailed on layout techniques!

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.