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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. load array data to dataset

load array data to dataset

Scheduled Pinned Locked Moved Database
data-structureshelp
4 Posts 3 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
    jashimu
    wrote on last edited by
    #1

    Hi all, I am trying to load data from a array to dataset or any other ways to display the data in a datagridview. if you can please help me in this regard. thanks

    D 1 Reply Last reply
    0
    • J jashimu

      Hi all, I am trying to load data from a array to dataset or any other ways to display the data in a datagridview. if you can please help me in this regard. thanks

      D Offline
      D Offline
      Dr Walt Fair PE
      wrote on last edited by
      #2

      You didn't say anything about what type of data or whether you need a DataSet for other reasons, but assuming you just want to display the data and nothing else, just run through a loop and add DataGridView rows and put your data in a cell. Simple, but the details of how you do it depend on what language you are using.

      CQ de W5ALT

      Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

      J 1 Reply Last reply
      0
      • D Dr Walt Fair PE

        You didn't say anything about what type of data or whether you need a DataSet for other reasons, but assuming you just want to display the data and nothing else, just run through a loop and add DataGridView rows and put your data in a cell. Simple, but the details of how you do it depend on what language you are using.

        CQ de W5ALT

        Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

        J Offline
        J Offline
        jashimu
        wrote on last edited by
        #3

        Hello Walt Fair,What I want to do is that I have an array of string, how do I put the array data in a grid view by column and row. thanks

        S 1 Reply Last reply
        0
        • J jashimu

          Hello Walt Fair,What I want to do is that I have an array of string, how do I put the array data in a grid view by column and row. thanks

          S Offline
          S Offline
          Steven J Jowett
          wrote on last edited by
          #4

          You need to loop through your array of strings and add a new row to your dataset and populate the fields of your new row with your data from the array Example (VB.NET)

          For idx As Integer = 0 To myArray.Length -1
          Dim row as DataRow = myDataSet.Table(0).NewRow
          row(0) = myArray(idx)
          myDataSet.Rows.Add(row)
          Next

          Steve Jowett ------------------------- Real programmers don't use PL/1. PL/1 is for insecure momma's boys who can't choose between COBOL and Fortran.

          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