Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a construction program for a school project that uses a database to store info about customers, sites and individual houses. The program is supposed to make an invoice at the form of a PDF which pulls data from 3 tables: the individual house table, the materials used table and the material quantity table.

If the user wants to open an existing one, I want the program to use data binding to fill in the components with data that has been selected previously. For example, I have a datagridview which displays all the houses. When the user selects one of the houses from the datagridview, a new form will appear where they select the materials used. If this has already been selected previously, the program needs to get the value out of the database and fill it in. I was initially going to use loads of SQL queries and fill in each textbox, combo box and all the other controls but figured it would take too much time and would probably be very inefficient. I only just found out about data binding and have seen some simple tutorials online.

Would data binding be a good way to fill in the controls which have already been selected by the user? If so, how would I link it to which plot has been selected on the datagridview on the other form?

Thanks for reading and sorry if I didn't explain it well enough.

What I have tried:

I have followed a few simple tutorials on Youtube using controls on one form and only pulling data from one table
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900