DataSet Merge, Master Details DataGrids, .xsd files, DataRelation, performance issues
Avoiding some really horrible performance with DataSet and DataGrid classes when following a pattern from the documentation for loading data which fills a temporary DataSet which is then Merged into the persistent DataSet. Merging more than a few hundred rows is dog slow.
I modified the .xsd file produced by dragging tables to a new file according to the pattern from the MasterDetails QuickStart sample. The key thing, I think, is that the generated .cs file defines a DataRelation between the Company and Job tables, “CompanyJobs”. By setting the DataMember property to “Company.CompanyJobs” instead of just “Job”, I get just the kind of linkage I expected. By controlling the DataMember property via a menu pick, the same DataGrid layout serves double duty.
It’s key to also use the data member string when obtaining a DataView object for the grid, for pick correlation for example.