ADO.Net-数据集关系 [英] ADO.Net - Dataset relations
本文介绍了ADO.Net-数据集关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个查询.请帮帮我.
我有两个桌子-主人和一个孩子.这两个表在两侧的复合键上都与/foriegn键链接..
然后,如何建立数据集关系.请给示例2行代码.. plz.
问候,
KVS.
Hi All,
I have a query. Please help me.
I have two tables - Master and a child. These two tables are linked with / foriegn key on both sides composite keys..
Then, how to build Dataset relations. Please give a sample 2 lines code .. plz.
Regards,
KVS.
推荐答案
您尝试过什么吗?
提示:DataRelation
构造函数接受DataColumn[]
作为参数.
Have you tried anything?
Hint:DataRelation
constructor acceptsDataColumn[]
as parameter.
此处:
ADO.NET中的数据关系 [父母/儿童DataRelation.基础知识. [
Here:
DataRelations in ADO.NET[^]
Parent/Child DataRelation. The Basics.[^]
如果要定义数据表之间的关系 ^ ]就是为了这个目的.文档中有一个很好的示例.
如果您使用组合键,只需将所有列添加到 ParentColumns [^ ]和 ChildColumns [构造器 [
If you want to define a relation between data tables DataRelation[^] is for that purpose. There''s a good sample in the doc.
If you use composite keys, just add all the columns in the ParentColumns[^] and ChildColumns[^]
This can also be done directly in the constructor[^]
这篇关于ADO.Net-数据集关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文