如何在 DataSet C# 中加入多个表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/602102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 09:54:56  来源:igfitidea点击:

How can you Join multiple tables in a DataSet C#

c#ado.net

提问by Omar Kooheji

I've converted an xml document into a DataSet with DataTables containing relational infomation.

我已经将一个 xml 文档转换为一个包含关系信息的数据表的数据集。

I need to merge the tables into a single table exploiting the relational information is there a way to Do SQL like queries on a Dataset to get a dataTable which can be subsequently used to populate a datagrid?

我需要利用关系信息将表合并到一个表中,有没有办法在数据集上执行类似 SQL 的查询,以获得随后可用于填充数据网格的数据表?

回答by PaulB

You probably want to look at the DataRelation class.

您可能想查看 DataRelation 类。

I wont repeat all the MSDNdocs.

我不会重复所有的MSDN文档。