Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. split datatable column using c#

split datatable column using c#

Scheduled Pinned Locked Moved Database
csharpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jaimin H Soni
    wrote on last edited by
    #1

    Hi i want to split column into multiple columns using c#. Ex. 100 rows in COLUMN_A , convert into COLUMN_A1(Firt 20 records) COLUMN_A2(next 20 records) COLUMN_A3(next 20 records) COLUMN_A4(next 20 records) COLUMN_A5(next 20 records) is it posiblie?

    L 1 Reply Last reply
    0
    • J Jaimin H Soni

      Hi i want to split column into multiple columns using c#. Ex. 100 rows in COLUMN_A , convert into COLUMN_A1(Firt 20 records) COLUMN_A2(next 20 records) COLUMN_A3(next 20 records) COLUMN_A4(next 20 records) COLUMN_A5(next 20 records) is it posiblie?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Jaimin H Soni wrote:

      is it posiblie?

      Yes, simply read it row by row and stuff the contents in a column. That'd be assuming that a "row" could fit in a single "column". Can you show an example row?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      J 1 Reply Last reply
      0
      • L Lost User

        Jaimin H Soni wrote:

        is it posiblie?

        Yes, simply read it row by row and stuff the contents in a column. That'd be assuming that a "row" could fit in a single "column". Can you show an example row?

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        J Offline
        J Offline
        Jaimin H Soni
        wrote on last edited by
        #3

        I have datatable that have one column in that 112 rows and i want to convert like that col1 20 rows (1 to 20) col2 20 rows (21 to 40) col3 20 rows (41 to 60) col4 20 rows (61 to 80) col5 20 rows (81 to 100) col6 20 rows (100 to 112)

        L 1 Reply Last reply
        0
        • J Jaimin H Soni

          I have datatable that have one column in that 112 rows and i want to convert like that col1 20 rows (1 to 20) col2 20 rows (21 to 40) col3 20 rows (41 to 60) col4 20 rows (61 to 80) col5 20 rows (81 to 100) col6 20 rows (100 to 112)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Then you'd have to add some columns to the datatable, and loop the records.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          J 1 Reply Last reply
          0
          • L Lost User

            Then you'd have to add some columns to the datatable, and loop the records.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            J Offline
            J Offline
            Jaimin H Soni
            wrote on last edited by
            #5

            I tried looping but i cannot get exactly what i want...

            L 1 Reply Last reply
            0
            • J Jaimin H Soni

              I tried looping but i cannot get exactly what i want...

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Show us your code :)

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups