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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:55:14+00:00 2026-05-23T18:55:14+00:00

I have an complex object on my web server – lets say the object,

  • 0

I have an complex object on my web server – lets say the object, for instance, represents a survey.

So this survey object has many questions and each question can have many possible answer options – basically it is a hierachical object.

Let say further, that in the database, they tables are roughly of a similar structure (ie. a survey table which link to a question table which links to a answer options table).

If we want to populate the object from SQL is the only way to do this to:

  1. Select the survey details from the database
  2. Select all the questions that appear in that survey from the database
  3. Select all the answer options that are available to the questions in the survey from the database
  4. Iterate over the results on the web server and populate the Survey object accordingly.

(This is bespoke code so the various entity frameworks are not an option).

Is there are better way to do this? It is correct that I am iterating through all these results and populating my object accordingly or is there an easier way?

  • 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-23T18:55:15+00:00Added an answer on May 23, 2026 at 6:55 pm

    It is not entirely clear on what abstraction level do you access the database. ADO.NET SqlCommands?

    Are all OR/M frameworks out of question? Then you won’t get complex “objects” back from the data tier automatically. This is one of the major jobs of an OR/M tool that it can load the data into an object or object-hierarchy based on a mapping. If you don’t use a framework for this, you have to iterate the “raw SQL rows” yourself and copy them into an object structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a page in my web application that lets a user update
If i have a complex object, what is the best practice pattern to write
I have a pretty complex object graph G with an object o1 in G
What is the format for databinding to a complex object? I have a linq
I have a List of a complex type - an object with a few
I have a complex .NET Remoting server app that provides a couple of services.
I have an HttpResponse object for a web request I just made. The response
I have a complex object graph to represent operation scheduling. At one point, I
I have a java application that has Web Services published using Axis. With the
I have a complex JSON object that I want represent as C# class. I

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.