Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,I want to create a sheet or utilty that contains database and it's contents(fields) on left hand side(say a section)...i want to give the facility to user to choose the fields...and datagridview should be populated with respected field...please help me out..thanks in advance...
Posted

1 solution

For this purpose you can use Master Detail relationship to display the data.

The left hand side fields you have said are to be stored in one data table say Orders (as found in Northwind sample database of MicroSoft) as rows. Create another DataTable say Order Details to store the data to be displayed on the right hand side. Establish a DataRelation between these table using the Primary Key and Foreign Key values. Say OrderId column is present in both the tables, then the DataRelation can be established between these columns. Each row of Orders DataTable has relation to the rows in Order_Details.

Please see the following article
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]
In demo program, under second tab page, Order and Order details, you can find a similar functionality. The article is in C# but you can convert the code to VB.NET using the online converter
http://converter.telerik.com/[^]
 
Share this answer
 
Comments
DileepkumarReddy 26-Mar-12 23:43pm    
Thanks for suggestion....i will try it out...

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