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. General Programming
  3. C#
  4. Loading class objects from datasets

Loading class objects from datasets

Scheduled Pinned Locked Moved C#
databasebusinessregexquestion
3 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.
  • M Offline
    M Offline
    moazzamahmed
    wrote on last edited by
    #1

    hi all, My business layer contains 1 object per table in my database. Object properties are the same as table fields. I get a dataset with 1 row back from my database when I instantiate my objects. Is there a way to load this dataset into my object properties (fields)? without having to traverse and match the nodes on the dataset to my properties? this way, I can use the same method for all my objects AND I dont have to worry about the function if I change my object or table. any ideas? thanks M

    N 1 Reply Last reply
    0
    • M moazzamahmed

      hi all, My business layer contains 1 object per table in my database. Object properties are the same as table fields. I get a dataset with 1 row back from my database when I instantiate my objects. Is there a way to load this dataset into my object properties (fields)? without having to traverse and match the nodes on the dataset to my properties? this way, I can use the same method for all my objects AND I dont have to worry about the function if I change my object or table. any ideas? thanks M

      N Offline
      N Offline
      Nicholas Butler
      wrote on last edited by
      #2

      Hi You could use reflection for this. ---------------------------- Be excellent to each other :) EasiReports[^] My free reporting component for WinForms.

      M 1 Reply Last reply
      0
      • N Nicholas Butler

        Hi You could use reflection for this. ---------------------------- Be excellent to each other :) EasiReports[^] My free reporting component for WinForms.

        M Offline
        M Offline
        moazzamahmed
        wrote on last edited by
        #3

        how? is there an example somewhere out there?

        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