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

  • SEARCH
  • Home
  • 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 7824825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:43:36+00:00 2026-06-02T08:43:36+00:00

I am building a form in Delphi that has a dropdown of Services and

  • 0

I am building a form in Delphi that has a dropdown of Services and a grid of Add-Ons for the select service. The data I am getting comes from an API and I am storing the data for the Services in an ADODataSet as follows:

ID (integer)
Name (string)
Description (string)
BasePrice (currency)
AddOns (array of AddOn, not currently stored in the ADODataSet)

I would like to have the grid populate with the AddOn data based on the selection from the dropdown (each Service has a different list of Add-Ons). How do I store the AddOn information so that it can be related back to the Service info? Do I need to create a second ADODataSet or is there a way to store it in the same ADODataSet as the Services?

The AddOns have the following fields:

ID (integer)
Name (string)
Description (string)
UnitPrice (currency)
Quantity (integer)

I am using Delphi 2005 and have Indy for Delphi.

EDIT

In digging around the Fields editor for Datasets I found that I can create a field of type ‘DataSet’. Would this allow me to tie the two together? If so can someone explain how that is done?

I tried to do it by creating a second dataset (ADODataSetAddOns) and assigning the new dataset to the dataset field in the first dataset (ADODataSetServices.AddOns) but get the error message ‘No matching ADO data type for Dataset’, which I assume is referring to the AddOns field not finding a dataset.

  • 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-06-02T08:43:38+00:00Added an answer on June 2, 2026 at 8:43 am

    You can use 2 datasets (master-detail) to show the relation between the Services and Addons and then using TClientDataset as memory dataset you can store the selections using the Service Id, Addon Id pair as Index, the structure of this client dataset can be created in runtime like this

      ClientDataSet1.FieldDefs.Clear;
      ClientDataSet1.FieldDefs.Add('IdService', ftInteger);
      ClientDataSet1.FieldDefs.Add('IdAddon ', ftInteger);
      //add morr fieldd here is you want 
      ClientDataSet1.IndexDefs.Add('Index1','IdService;IdAddon',[ixPrimary, ixUnique]);
      ClientDataSet1.IndexName:='Index1';
      ClientDataSet1.CreateDataSet;
    

    and finally when you need pass the data selected by the user to the service you can iterate over the ClientDataset just as any TDataset.

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

Sidebar

Related Questions

I'm building a form in access that has a several sub-forms in a tab
I'm building a login form composite component. The page that uses it will pass
I'm building a contact form that appears in a jQuery popup box. When you
I'm building a Windows Form that includes a combo box control, and I wanted
I'm building a form in ASP.NET MVC3 + Razor that posts to a PHP
I am building a form that needs to accept characters encoded in SHIFT_JIS and
I'm building a form in Drupal that needs to submit to a 3rd party
I am stumped! I am building a form that allows the user to fill
I'm building a form for inputting data into a web database. Everything is going
I am building a form in HTML out of a javascript object that I've

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.