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. output to struct

output to struct

Scheduled Pinned Locked Moved Database
databasequestionc++data-structureshelp
2 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.
  • G Offline
    G Offline
    ginjikun
    wrote on last edited by
    #1

    hi all! im not sure but i guess i should have posted my question in this forum since it concerns sql... my question is regarding querying the database which results in multiple records which should be mapped to struct. can someone please show me how to do this? i have written vc++ code which queries the database but have only done this with 1 result which contains a few number of fiels which i have assigned to individual variables :( now what i would like is to create an array of structs based on multiple records which was selected based on the query. thanks for any help! newbie :)

    C 1 Reply Last reply
    0
    • G ginjikun

      hi all! im not sure but i guess i should have posted my question in this forum since it concerns sql... my question is regarding querying the database which results in multiple records which should be mapped to struct. can someone please show me how to do this? i have written vc++ code which queries the database but have only done this with 1 result which contains a few number of fiels which i have assigned to individual variables :( now what i would like is to create an array of structs based on multiple records which was selected based on the query. thanks for any help! newbie :)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You do this in C++ code. Create a vector of structs, and for each row, read the values, build an instance of the struct, and push it into the vector.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      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