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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:10:33+00:00 2026-05-15T14:10:33+00:00

How can i solve below string join error. i converted int value to string

  • 0

How can i solve below string join error. i converted int value to string value but error occurs…. Look Join method

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace SortArrayYusuf
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[] array;

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

            //foreach (int value in array)
            //    Console.WriteLine(value);

            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();
            }

            foreach (int[] row in lengths)
            {
                Console.WriteLine(string.Join(", ", row.ToString()));
            }
            Console.ReadKey();
        }

        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;
        }
    }
}

 foreach (int[] row in lengths)
            {
                Console.WriteLine(string.Join(", ", row.ToString()));
            }

  • 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-15T14:10:34+00:00Added an answer on May 15, 2026 at 2:10 pm
    Console.WriteLine(string.Join(", ", row.Select(x => x.ToString()).ToArray()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Why not? And compared to what? There is a learning… May 16, 2026 at 11:30 pm
  • Editorial Team
    Editorial Team added an answer #include <iostream> #include <fstream> int main(int argc, char **argv) {… May 16, 2026 at 11:30 pm
  • Editorial Team
    Editorial Team added an answer Java: http://en.wikipedia.org/wiki/New_I/O A multiplexed, non-blocking I/O facility for writing scalable… May 16, 2026 at 11:30 pm

Trending Tags

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

Top Members

Related Questions

if i compiled below codes error return foreach loop how can i solve it?
I'm trying to display versionName using below code PackageManager pkm = getPackageManager(); PackageInfo pki
I have a class that I am using below. And I am using this
I wrote the below code to get a string (encrypted) from the user, and
As I am new for the REGEX i am not able to solve below
I'm having trouble building an Entity Framework LINQ query whose select clause contains method
The code below works perfect for binding actual urls grabbed from the net. My
In my code I have 2 ComboBox DropDownLists, created by the code below. The
This may seem like an odd question, but I have my own reasons for
UPDATE - No need to answer this now, I have solved below. Hi, I'm

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.