过滤关系数据集 [英] Filtering Relationa DataSets

查看:119
本文介绍了过滤关系数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关系数据集,我希望在一个DataGrid中过滤父级并显示父级过滤器的结果,而Child则在另一个DataGrid中显示.
在应用过滤器之前,两个DataGrid均显示正确的数据.然后,子网格断开连接,并且当我从父网格的一行切换到下一行时,它不会改变.:confused:
非常感谢任何帮助.

很明显,我对问题的定义不够严格.
这是我正在使用Studio 2003进行的Windows应用程序.
我有一个XML定义的数据集,可通过从文件中提取ADS数据来填充.

I have a relational dataset and I wish to filter the parent and display the results of the parent filter, in one DataGrid and the Child results in another DataGrid.
Both DataGrids show the correct data prior to the filter being applied. The child grid then becomes disconnected and does not change as I switch from one row of the parent grid to the next.:confused:
Any assistance much appreciated.

I obviously did not define my problem tightly enough.
It is a Windows application I am working on, using Studio 2003.
I have an XML defined data set which I fill by extracting ADS data from files.

推荐答案

这取决于您如何创建初始数据库连接并填充数据.

如果您是手动加载数据,则需要查看当前的父行"以获取行ID(或您正在使用的任何关系字段),以传递给读取器以进行子查询.

如果您使用的是BindingSources/Binding Navigators等,那么这会简单得多.

我建议您在这里观看其中一些视频(基于数据的表格系列);
http://msdn.microsoft.com/en-gb/vbasic/bb466226.aspx#formsoverdata [^ ]

有一些很棒的视频展示了它们如何相互融合.
This depends on how you are creating the initial database connections and filling the data.

If you are manually loading the data, then you would need to look at the current Parent Row to get the row id (or whatever relationship field you are using) to pass to the reader for the child query.

If you are using BindingSources/Binding Navigators etc, this would be a lot simpler.

I suggest you look at some of these videos (Forms Over Data Series) here;
http://msdn.microsoft.com/en-gb/vbasic/bb466226.aspx#formsoverdata[^]

There are some great videos that show how it all hangs together.


这篇关于过滤关系数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆