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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:01:16+00:00 2026-05-21T21:01:16+00:00

Can you help my problem? I have 2 tables : product (as parent) and

  • 0

Can you help my problem?

I have 2 tables : product (as parent) and sales (as a child).

product table consists of:
product_id | product_name | product_price |
1 | book | $5 |

sales table consist of:
transaction_id | product_id | quantity | total_price |
A001 | 1 | 10 | $50 |

  1. product_id at the product table is pK for product table.
  2. transaction_id at the sales table is pK for sales table .
  3. product_id at the sales table as fK, which a reference to the product_id of product table

All my tables are stored in the dataset. How do I get the data from these datasets can I view on the DataGridView with a different layout formats, as follows.

transaction_id | product_name | product_price | quantity | total_price |
A001 | book | $5 | 10 | $50 |

Thanks & Best Regards,

YDA

  • 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-21T21:01:17+00:00Added an answer on May 21, 2026 at 9:01 pm

    Can you write your query to populate your dataset in the format you want? If so, I think you can just databind the resulting datatable to the DataGridView and get what you want. So your query would be something like:

    "SELECT transaction_id, product_name, product_price, quantity, total_price, A001, book, $5, 10, $50 from product join sales on product.productid = sales.productid"
    

    Of course, you would replace $5 and so on with the actual column names. Use that query to populate a dataset, then on your form.

    DataGridView.DataSource = DataSet.Tables("MyJoinedDataTable")
    

    Where “MyJoinedDataTable” is the name of the table that you populated in the dataset.

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

Sidebar

Related Questions

i have two tables product product_id product_Name product_Price product_Description product_image category_id another table category
can anyone help, i have problem doing a sort, I thought i had it
can anyone help? I have a problem aligning rounded corners in IE6/7. Basically everything
I hope some of you guys can help me with this problem.... I have
I have a PRODUCTS table, and each product can have multiple attributes so I
i have the following tables in relation many-to-many: table product: prd_cod (pk) cat_cod (fk)
Maybe you can help me with a problem I am having. The URL of
This problem is very strange and I'm hoping someone can help me. For the
I'm hoping someone can help me as I've been stuck on this problem for
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for

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.