You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alexandre Rabérin edited this page Jun 11, 2020
·
1 revision
DataSetGraph
The DataSetGraph is a directed graph of created from a DataSet schema, where each table is a vertex and each table relation is an edge.
It is defined in the QuikGraph.Data module.
Creating a DataSetGraph
You can create a DataSetGraph from any DataSet by using the ToGraph extension method.
A very useful application of the DataSetGraph is to compute the topological sort of the tables. The topological sort gives you the order in which you should fill tables (or reversely delete them).
DataSetdataSet=new();// Get your data setDataSetGraphgraph=dataSet.ToGraph();// Wraps the dataset into a DataSetGraphforeach(DataTabletableingraph.TopologicalSort())// Applies a topological sort to the data set graph{// ...}
Graphviz
QuikGraph has a bridge to Graphviz that has a specialized version for DataSetGraph available through DataSetGraphvizAlgorithm or more easily with extension ToGraphviz.