Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Problem with displaying result.
 

Problem with displaying result.

I have a serious problem here. I have 2 tables with a FK relationship. e.g customer and cheque. So cheque will hold the ID of the customer as a FK.

Now, i would like to display the result on a datagrid from the cheque table. I set the BindingSource as FKtblChequetblCustomerBindingSource.

I have 2 rows of data in the customer table with the ID of 21 and 22. Whenever i fill the datagrid using the above binding source, the datagrid only display ONE ID result which is customer id 21. Where has the id 22 goes to?
  • Moved byVMazurMVPTuesday, July 07, 2009 10:11 AM (From:ADO.NET Data Providers)
  •  
zlkoh  Tuesday, July 07, 2009 8:15 AM
Hi Alkoh,

It seems that records shown in the DataGridView are the child records corresponding to the parent record with ID of 21 in the customer datatable.

If this is the case, the value under the customerID column in the DataGridView will only be 21. You need to change the current row in the customer datatable to that row withID of 22.Thus, the corresponding child records are shown in the DataGridView and the value under the custom ID column in the DataGridView will be 22.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Wednesday, July 15, 2009 4:18 AM

It may be, that for customer (ID 22) dont have records in cheque.
Or check the dataloading Query, try to run it in query analyzer and see the result,
And none of these, then can you provide code ?

NareshG  Tuesday, July 07, 2009 10:30 AM
Hi Alkoh,

It seems that records shown in the DataGridView are the child records corresponding to the parent record with ID of 21 in the customer datatable.

If this is the case, the value under the customerID column in the DataGridView will only be 21. You need to change the current row in the customer datatable to that row withID of 22.Thus, the corresponding child records are shown in the DataGridView and the value under the custom ID column in the DataGridView will be 22.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Wednesday, July 15, 2009 4:18 AM

You can use google to search for other answers

Custom Search

More Threads

• AutoResizeColumnHeadersHeight problem with DataGridView
• Multiline datagridview
• Edit,update, cancel in DataGrid
• ListBox datasource question - basic
• ComboBox Items Not Showing On Dropdown
• how to assign DataGirdView data to another datagirdview
• TreeGridView Issues.
• DataGridView DataBinding ToString Interfaces Problem
• How to code a procedure to select all items in list box?
• SQLException