How to debug problem with binding of DataGrid to DataSet

N

Novice

Hi all, I don't imagine that I'm likely to get much of a response, but I was having a problem with the binding of a DataGrid to a DataSet and I could not figure out how to determine where the problem was - I ended up having to rewrite the code from scratch.

This is what was happening - I had a DataGrid control that contained every row from a table (call it TableA) in a database. Then I had a second DataGrid (on the same page) that would display the contents of a different table (call it TableB) based on a foreign key linked from TableB to TableA's Primary Key. Everything worked fine when I first created it and then subsequently when I recreated it - however, when I started adding additional DataGrid's and other code things got buggy. I should also add that there were only two records/rows in my TableA and only one in TableB.

When things were working, when I clicked the ButtonColumn button in the appropriate row in DataGridA, the correct row would appear in DataGridB, when I clicked the row without a linkage to DataGridB - no records/rows appeared in DataGridB. The problem that manifested itself was that regardless of which button I clicked in which row, the one row in TableB would appear in DataGridB.

I tried tracing the code into the vb code and found that the appropriate item index WAS being passed into the bind method I had created. I even used the quickwatch feature in VS .NET and checked the contents of the table. I also checked to ensure that the relation I had set up in my dataset was properly mapped (though I had never changed that).

If this sort of problem occurs again - can someone give me some advice on how to diagnose these problems?

Thanks,
Novice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top